加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

wcf – 使用Microsoft.Data.Services.Client.dll而不是System.Da

发布时间:2020-12-14 05:36:17 所属栏目:Windows 来源:网络整理
导读:我们有一个使用WCF 5.0和 WindowsAzure SDK的项目. 有两个引用Microsoft.Data.Services.Client.dll和System.Data.Services.Client.dll并且它们存在冲突.如果我删除系统DLL(根据this)我无法使用windowsAzure SDK.如果我删除Microsoft DLL,我无法利用WCF的新功
我们有一个使用WCF 5.0和 WindowsAzure SDK的项目.

有两个引用Microsoft.Data.Services.Client.dll和System.Data.Services.Client.dll并且它们存在冲突.如果我删除系统DLL(根据this)我无法使用windowsAzure SDK.如果我删除Microsoft DLL,我无法利用WCF的新功能,特别是OData 3.0版.

删除系统DLL引用后:

cannot convert from
‘System.Data.Services.Client.SaveChangesOptions [c:Program Files
(x86)Microsoft WCF Data
Services5.0bin.NETFrameworkMicrosoft.Data.Services.Client.dll]’ to
‘System.Data.Services.Client.SaveChangesOptions’

附加信息:

The best overloaded method match for
‘Microsoft.WindowsAzure.StorageClient.TableServiceContext.SaveChangesWithRetries(System.Data.Services.Client.SaveChangesOptions)’
has some invalid arguments

The type ‘System.Data.Services.Client.DataServiceContext’ is defined
in an assembly that is not referenced. You must add a reference to
assembly ‘System.Data.Services.Client,Version=3.5.0.0,
Culture=neutral,PublicKeyToken=b77a5c561934e089’.

如果我删除对Microsoft.Data.Services.Client的引用并添加对System.Data.Services.Client的引用,那么我们没有错误 – 我们也没有得到WCF 5.0!

解决方法

我能够很快地重现这个问题. Microsoft.WindowsAzure.StorageClient.Dll对System.Data.Service.Client.Dll具有直接引用依赖性,如下所示,因此,如果您要使用Azure Storage Client API,则必须引用System.Data.Service.Client.Dll在您的应用程序中,确保您不能使用WCF 5.0 SDK提供的oData 3.0.更多信息发布在以下SO问题中:

WCF 5.0 and oData 3.0 API not work with azure table storage

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读