【问题标题】:Getting exception System.Web.Http in VS2013 using breeze?使用微风在 VS2013 中获取异常 System.Web.Http?
【发布时间】:2013-10-29 07:21:32
【问题描述】:

我正在尝试使用 Breeze 和 AngularJS 从 Jhon Papa 创建 HotTowel 示例应用程序。我已经安装了所有必需的包,在安装 Breeze.WebApi 包之前一切正常,但是在我安装了这个包之后,我在 WebApiRoute 配置方法上得到了以下异常。

<ExceptionMessage>
Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's 
manifest definition does not match the assembly reference. (Exception from HRESULT: 
0x80131040)

我已引用 System.Web.Http dll 进行项目,但使用的是最新的 5.0.0 版本。

【问题讨论】:

标签: asp.net breeze


【解决方案1】:

您可以尝试进行绑定重定向以指向新程序集并查看它是否有效。

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

【讨论】:

  • 我需要在哪里添加这个配置?在web.config 或其他地方
  • 它将成为您 web.config 的一部分。 &lt;configuration&gt;&lt;runtime&gt;.....。检查你现有的配置,它可能已经有这个部分。
【解决方案2】:

这可能是尝试在 VS 2013 中使用新的 Microsoft WebApi2 nuget 包的结果。以前 Breeze 不支持这些。

截至目前,Breeze 1.4.5 已支持 Microsoft 的 ASP.NET WebApi 2 和 Entity Framework 6。请参阅http://www.breezejs.com/documentation/download

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-14
    • 2018-06-03
    • 1970-01-01
    • 1970-01-01
    • 2016-09-14
    • 1970-01-01
    • 2011-05-26
    • 1970-01-01
    相关资源
    最近更新 更多