gpt4 book ai didi

azure - Windows Azure 和 WCF 数据服务 V3

转载 作者:行者123 更新时间:2023-12-02 00:11:44 25 4
gpt4 key购买 nike

我的问题是:
为什么 WCF Data Services 5.2.0 在 Azure 模拟器下工作,而不是在 Azure 暂存/生产环境下工作?

我在服务器上收到此错误:

Could not load file or assembly Microsoft.Data.Services, Version=5.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)

相反,在模拟器上它可以完美地工作..

我的项目引用程序集是:

  • Microsoft.Data.Services 5.2.0.0
  • Microsoft.Data.Services.Client 5.2.0.0
  • Microsoft.Data.OData 5.2.0.0
  • Microsoft.Data.Edm 5.2.0.0
  • 系统.空间5.2.0.0
  • Microsoft.WindowsAzure.Storage 2.0.0.0

V3 对于以 JSON 形式显示数据非常有用,无需其他库。

最佳答案

该问题可能与 .svc 文件中存在对 GACed 版本的硬编码引用有关:5.0.0.0

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Forward.TestService " %>

如果您的 dll 将“复制本地”属性设置为 true,您应该能够删除版本并解决问题

<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Service="Forward.TestService " %>

关于azure - Windows Azure 和 WCF 数据服务 V3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14891093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com