First explain the problem: my original computer environment is win7+vs2015, because the new computer environment has become win10+vs2015, so the original project copied to the new machine, then the problem came, The original project was opened on the VS2015 directly error (Note: This is not published to IIS, is directly in VS F5 run). The fault of the report is very common, but the general solution is not to try to solve the problem is the boss.
Failed to load file or assembly "System.Web.Helpers, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" or one of its dependencies. The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040)
Here's how to start describing my solution:
1. According to the prompt error, cannot find this assembly, how possible, eventually found that the file version is incorrect.
Therefore, the version number of System.Web.Helpers in Webconfig is changed directly to 2.0.
Who knows and reported a new mistake, can not find System.Web.WebPages.Razor. This is not recorded in the Web. config ......... .........
2. immediately after I commented out a few of the assemblies, unfortunately there were more errors. I began to go back to the beginning of the problem, because the file version of the bin directory is not correct, this time I do not change the version number in the Web. config file, I went to find a System.Web.Helpers version number 1.0 DLL directly to the original to cover out.
So in the project folder search, found as shown, the second version of the DLL is 1.0, the first DLL version is 2.0, the version of 1.0 to overwrite the 2.0 version, re-run with VS, the result or error.
3. The following discussion speculated that there might be a problem with the. NET Framework version, because the version of VS2015 is directly 4.0 up, and the project uses 3.5, so in the control Panel, programs, and functions, Click the Enable or disable Windows feature to load the. NET Framework 3.5 and then shut down and restart again, the result is still not working.
4. since it is not the. NET Framework version of the problem, it is possible that the MVC version of the problem, the project is older, the use of MVC3, and VS2015 has no MVC3, the minimum version is MVC4.
Try to mount a MVC3 on VS2015 and click Manage NuGet packages on the references. Then click Install, then you can. It is found in the output process that the old DLL is replaced by the new DLL, and the MVC DLL file is also replaced.
Finally, turn on the VS run again and find out to run and no more errors.
Summary: This project transfer out of the wrong originally is not too pit, but because it is the system from Win7 replaced by WIN10, so I have a lot of inducement, just start always think is system change, cause the operating environment changed, so will appear this wonderful problem. Look at a lot of online reply said is that the history of Windows is heavy, a burst of spit groove, I have to say this is actually a pit . But this does not solve the problem, so also slowly study, after discussion, found the root of the problem.
An ASP. MVC3 project on the Win7 runs on the Win10 of a pit