无法在主机上加载程序集 WebPages.Deployment 版本 2?

2024-03-31

我有一个 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.

经过一番搜索后我发现this http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx这表明我应该在某些引用(包括 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.

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

我该如何解决这个问题?


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

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法在主机上加载程序集 WebPages.Deployment 版本 2? 的相关文章

随机推荐