c# - mvc was developed on vs2013 and now debugs on 2015 and reports an error. The details are as follows
習慣沉默
習慣沉默 2017-05-16 17:06:03
0
1
893

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

習慣沉默
習慣沉默

reply all(1)
刘奇

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.

 最方便的就是把System.Web.Mv.dll 文件放在系统的bin目录下面,但是这样重新生成或者做svn同步的时候就不方便了,给个方法:
  1. You can create a folder in the project to store .dlls that reference third parties

  2. Copy system.web.mvc.dll to this folder

  3. 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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template