asp.net-mvc 无法在主机上加载程序集 WebPages.Deployment 版本 2?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11359957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not load assembly WebPages.Deployment version 2 at host?
提问by Ivy
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 :
我有一个 ASP.NET MVC 2 网站 (VS2010),我已经升级到 ASP.NET MVC 3 (VS2012),这在本地 IIS7 上运行良好,但是在发布它时,我在主机上遇到了这个异常:
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 thisthat 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?
经过一番搜索,我发现这表明我应该在一些引用(包括 System.Web.WebPages)上设置 CopyLocal 并使用 VS2012 中的发布工具,但这产生了以下异常?
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?
我找不到任何部署 dll 来设置 copyLocal?
How could I solve this?
我怎么能解决这个问题?
回答by magritte
Have a read of http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net
阅读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.
您需要添加对 System.Web.WebPages.Deployment 的引用并将其设置为 CopyLocal。

