首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Microsoft.WindowsAzure.StorageClient.TableServicesContext和检测并发更新冲突

使用Microsoft.WindowsAzure.StorageClient.TableServicesContext和检测并发更新冲突
EN

Stack Overflow用户
提问于 2013-06-01 18:33:13
回答 1查看 552关注 0票数 5

问题是某些类(DataServiceClientException / DataServiceRequestException / DataServiceResponse)同时存在于System.Data.Services.Client.dll和Microsoft.Data.Services.Client.dll中。简单的方法是只使用其中一个库。不幸的是:

  • 不能删除Microsoft.WindowsAzure.StorageClient.TableServicesContext,因为使用System.Data.Services.Client.dll是必需的
  • Microsoft.WindowsAzure.StorageClient.TableServicesContext在Azure上需要Microsoft.Data.Services.Client.dll。

通常,这两个库一起工作很好。但是,实现来自这里的代码以检测并发冲突会导致错误:

代码语言:javascript
复制
Error   1   The type 'System.Data.Services.Client.DataServiceRequestException' exists in both 'C:\Program Files\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.Services.Client.dll' and 'C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.Client.dll'
Error   2   The type 'System.Data.Services.Client.DataServiceResponse' exists in both 'C:\Program Files\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.Services.Client.dll' and 'C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.Client.dll'
Error   3   The type 'System.Data.Services.Client.DataServiceClientException' exists in both 'C:\Program Files\Microsoft WCF Data Services\5.0\bin\.NETFramework\Microsoft.Data.Services.Client.dll' and 'C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.Services.Client.dll'

因为System.Data.Services.Client.DataServiceClientExceptionDataServiceRequestExceptionDataServiceResponse类不能访问,因为它们都存在于两个库中。如何在使用Microsoft.WindowsAzure.StorageClient.TableServicesContext?时检测并发更新冲突

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-06-01 18:43:51

解决方案是使用C#的外接别名特性。

  1. 展开项目的“参考”部分。
  2. 右键单击System.Data.Services.Client并选择属性。
  3. 将别名从“全局”更改为“系统”或其他内容。

这个项目建设得很好。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16875964

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档