How to resolve? Assuming assembly reference 'System.Web.Mvc

With reference to questions/26393157/windows-update-caused-mvc3-and-mvc4-stop-working. The quickest way to resolve the warning below?

Assuming assembly reference 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' matches 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35', you may need to supply runtime policy.


As per the best answer to the question....

  • Update MVC package (Visual Studio > Right click project/solution > manage nuget packages > Updates > Microsoft ASP.NET MVC > Update)
  • Manually add the compilation assembly
  • but then

  • Find - System.Web.Mvc, Version=4.0.0.0
  • and replace with - System.Web.Mvc, Version=4.0.0.1
  • Which will find all the hidden references in the Views/Web.config files.


    I've had this happen with my NuGet packages every once in a while. I haven't been able to identify exactly how it happens. (I assume user error.) I didn't need to upgrade anything to solve it, just clear the NuGet cache:

    I use the nuget command line tool found here.

    You can clear all caches with this command:

    nuget locals all -clear
    

    See: https://docs.nuget.org/consume/command-line-reference

    You'll probably need to restart Visual Studio if it is open.


    After tested all propositions, I finally succeeded to get rid of the warning by editing the .csproj of my web application and set the property MvcBuildViews to false.

    Maybe this could help some of you.

    链接地址: http://www.djcxy.com/p/64292.html

    上一篇: 我运行我的mvc应用程序时出现编译错误

    下一篇: 如何解决? 假设程序集引用'System.Web.Mvc