Could not load file or assembly 'System.Web.Mvc' or one of its dependencies

前端 未结 5 419
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 21:56

I have this new MVC application which I have installed on Windows 2008 Server. And get the following message when I run the localhost.

I have checked in the Bin fol

相关标签:
5条回答
  • 2020-12-31 22:16

    Right click on System.Web.Mvc in your reference folder and make sure that copy local is set to true. That should add System.web.mvc to your bin folder and it should correct the problem.

    0 讨论(0)
  • 2020-12-31 22:21

    Right Click to Project -> Manage Nuget Packages for solution than update

    Microsoft.AspNet.Mvc and Microsoft.Net.Compilers

    0 讨论(0)
  • 2020-12-31 22:25

    Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0,..."

    Your application is using MVC3, but according to your own comment, the server has MVC2 (2.0.50217.0).

    0 讨论(0)
  • 2020-12-31 22:33

    I had this problem when deploying to a server which ran MVC2, the files which will need to be included in the build are:

    Microsoft.Web.Infrastructure.dll
    System.Web.Helpers.dll
    System.Web.Mvc.dll
    System.Web.Razor.dll
    System.Web.WebPages.Deployment.dll
    System.Web.WebPages.dll
    System.Web.WebPages.Razor.dll
    

    Phil Haack has done a good post here (for how to solve if you run into this problem when deploying)

    http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

    0 讨论(0)
  • 2020-12-31 22:38

    If you have rights to do so, you can download and install MVC3 on your webserver.

    0 讨论(0)
提交回复
热议问题