【问题标题】:Could not load assembly WebPages.Deployment version 2 at host?无法在主机上加载程序集 WebPages.Deployment 版本 2?
【发布时间】:2012-07-06 18:43:09
【问题描述】:

我有一个 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 指出我应该在某些引用(包括 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.

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

我该如何解决这个问题?

【问题讨论】:

    标签: asp.net-mvc visual-studio iis hosting .net-assembly


    【解决方案1】:

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

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

    【讨论】:

    • 很遗憾,但是这个链接现在已经失效了(404 错误);并带您到该网站的主页。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多