Could not load assembly WebPages.Deployment version 2 at host?

旧时模样 提交于 2019-12-05 12:52:14

问题


I have a ASP.NET MVC 2 website (VS2010) that I have upgraded to ASP.NET MVC 3 (VS2012) and this works fin on local IIS7 but when publishing it I get this exception on host :

 Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

After some seartch I found this that states that I should set CopyLocal on some of the references(inlcuding the System.Web.WebPages) and also use the publish tool in VS2012, but this generated the following exception?

Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

And I can´t find any Deployment dll to set copyLocal?

How could I solve this?


回答1:


Have a read of http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net

You need to add a reference to System.Web.WebPages.Deployment and set that also to CopyLocal.



来源:https://stackoverflow.com/questions/11359957/could-not-load-assembly-webpages-deployment-version-2-at-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!