【问题标题】:Moving from visual studio 2008 to visual studio 2010从 Visual Studio 2008 迁移到 Visual Studio 2010
【发布时间】:2010-08-09 23:55:49
【问题描述】:

对此的任何解决方案:

Assembly 'DomainModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 使用 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35',其版本高于引用的版本程序集“System.Web.Mvc,版本=1.0.0.0,文化=中性,PublicKeyToken=31bf3856ad364e35”

DomainModel\bin\Debug\DomainModel.dll

我重新添加了指向 mvc2 的引用,还需要什么?还是这个错误。

谢谢!

【问题讨论】:

    标签: asp.net-mvc-2


    【解决方案1】:

    您需要在 web.config 文件中添加程序集绑定重定向部分:

    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
        </dependentAssembly>
      </assemblyBinding>
    </runtime>
    

    【讨论】:

    • 这对我仍然没有帮助。配置文件已经包含上述内容,因为它应该在安装 Visual Studio 2010 时自动填充。
    • 从 2008 年转换到 2010 年时,它会自动填充,所以我不必触摸。我什至尝试重新添加参考,但仍然没有运气。
    • DomainModel 是您的 MVC 应用程序还是一个单独的项目?
    • DomainModel 是 MVC 中项目文件的一部分
    • 你们有多项目解决方案吗?如果是,请检查其他项目的参考资料
    猜你喜欢
    • 1970-01-01
    • 2017-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多