对于我的机器人,我想将数据保存到 Azure 存储表中。我正在按照此 MSDN link 的说明进行操作将 Azure 存储 API 添加到我的控制台应用程序 (.net=4.5.2v)。安装下面的包时出现错误
Install-Package Microsoft.Azure.CosmosDB.Table -Version 1.1.3
错误
Install-Package : Unable to resolve dependencies. 'Microsoft.Azure.DocumentDB 1.22.0' is not compatible with 'Microsoft.Azure.CosmosDB.Table 1.1.3 constraint:
Microsoft.Azure.DocumentDB (>= 1.22.0)
我尝试使用
安装依赖库Microsoft.Azure.DocumentDB
Install-Package Microsoft.Azure.DocumentDB -Version 1.22.0
然后我尝试安装 Microsoft.Azure.CosmosDB.Table
,它给出了相同的错误
如何解决这个问题?
最佳答案
Install-Package : Unable to resolve dependencies. 'Microsoft.Azure.DocumentDB 1.22.0' is not compatible with 'Microsoft.Azure.CosmosDB.Table 1.1.3 constraint: Microsoft.Azure.DocumentDB (>= 1.22.0)
我可以重现同样的问题。我检查 Microsoft.Azure.CosmosDB.Table 1.1.3 的依赖关系并发现它需要 Microsoft.Azure.Storage.Common (>= 8.6.0-preview && <= 9.0.0.1-preview)。
要解决此问题,您可以将 Microsoft.Azure.Storage.Common 降级到 9.0.0.1-preview。以下 packages.config
适用于我,您可以尝试在控制台应用程序中使用它。
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Azure.CosmosDB.Table" version="1.1.3" targetFramework="net452" />
<package id="Microsoft.Azure.DocumentDB" version="1.22.0" targetFramework="net452" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Azure.Storage.Common" version="9.0.0.1-preview" targetFramework="net452" />
<package id="Microsoft.Data.Edm" version="5.8.2" targetFramework="net452" />
<package id="Microsoft.Data.OData" version="5.8.2" targetFramework="net452" />
<package id="Microsoft.Data.Services.Client" version="5.8.2" targetFramework="net452" />
<package id="Microsoft.OData.Core" version="7.2.0" targetFramework="net452" />
<package id="Microsoft.OData.Edm" version="7.2.0" targetFramework="net452" />
<package id="Microsoft.Spatial" version="7.2.0" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="System.ComponentModel.EventBasedAsync" version="4.0.11" targetFramework="net452" />
<package id="System.Dynamic.Runtime" version="4.0.0" targetFramework="net452" />
<package id="System.Linq.Queryable" version="4.0.0" targetFramework="net452" />
<package id="System.Net.Requests" version="4.0.11" targetFramework="net452" />
<package id="System.Spatial" version="5.8.2" targetFramework="net452" />
</packages>
关于c# - 无法将 azure storage api nuget 包添加到我的控制台应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51839082/