无法在主机上加载程序集 WebPages.Deployment 版本 2? [英] Could not load assembly WebPages.Deployment version 2 at host?

查看:17
本文介绍了无法在主机上加载程序集 WebPages.Deployment 版本 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ASP.NET MVC 2 网站 (VS2010),我已经升级到 ASP.NET MVC 3 (VS2012),这在本地 IIS7 上运行良好,但是在发布它时,我在主机上遇到了这个异常:

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.

经过一番搜索,我发现 this 指出我应该设置 CopyLocal在一些参考资料(包括 System.Web.WebPages)上,也在 VS2012 中使用了发布工具,但这产生了以下异常?

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.

我找不到任何部署 dll 来设置 copyLocal?

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

我该如何解决这个问题?

How could I solve this?

推荐答案

阅读http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net

您需要添加对 System.Web.WebPages.Deployment 的引用并将其设置为 CopyLocal.

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

这篇关于无法在主机上加载程序集 WebPages.Deployment 版本 2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆