I tried to upload my web site to a server. It was working fine with my local host, so I uploaded everything in my localhost wwwroot
folder to the server and changed the connection string.
But there is this error:
Exception information: Exception type: InvalidOperationException Exception message: The pre-application start initialization method Start on type RouteDebug.PreApplicationStart threw an exception with the following error message: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. at System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) at System.Web.Compilation.BuildManager.CallPreStartInitMethods() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. at RouteDebug.PreApplicationStart.Start()
The project was nopcommerce
.
What should be done to resolve this error?
You will need to include the dll with your project and add a reference to it as well.
Here is a link to a similar issue already on Stack: MVC3 Deployment Dependency Problems
It turns out after doing a Reference Cleaning, it removed Microsoft.Web.Infrastructure
, but not from the packages.config file. After trying to add it again using the Package Manager Console
, Visual Studio says that it is already installed which is false because it was removed.
I then removed the line of code in the packages.config
file
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
and ran the command again
PM> Install-Package Microsoft.Web.Infrastructure
After this, now it works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With