Details of error report
An exception of type 'System.IO.FileNotFoundException' occurred in System.Web.Mvc.dll but was not handled in user code
Additional information: Could not load file or assembly 'System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system can not find the file specified.
picture
Has anyone encountered such a problem? Please help
After analysis, the reason is that 'System.Web.Mvc version 2.0 is released with VS2010 and is generally located in C:/Program Files/Microsoft ASP.NET/ASP.NET MVC 2/Assemblies/System.Web.Mvc.dll, So we need to do some processing on the reference when using it.
You can create a folder in the project to store .dlls that reference third parties
Copy system.web.mvc.dll to this folder
Change the reference to this dll in the Web project to system.web.mvc.dll under the folder
4. Set the "Copy Local" property to the DLL that is TRUE. This can be done by browsing to the Web project's References folder and clicking on the System.Web.Mvc pull-up properties, selecting "Properties "Copy Local" and making sure it is set to True.
This way it won't change every time you publish or regenerate This dynamic library will be missed.
The problem is solved and the deployment is successful!
Source: http://blog.csdn.net/zhensoft163/article/details/7106046