安装 Microsoft.Azure.CosmosDB.Table NuGet 时出错

Error installing Microsoft.Azure.CosmosDB.Table NuGet

正在尝试安装 Microsoft.Azure.CosmosDB.Table 版本 1.1.3,但不断出现错误

Unable to resolve dependency 'Microsoft.Azure.Storage.Common'. Source(s) used: 'nuget.org', 'Microsoft Visual Studio Offline Packages'

我当前的项目来自 Azure QnA 机器人模板

如有任何帮助,我们将不胜感激!

Error installing Microsoft.Azure.CosmosDB.Table NuGet

这是一个 known issue on GitHub,如果项目配置为使用 packages.config,此问题将自行显现。

此问题已为 PackageReference 修复。 NuGet 团队正在确定是否需要为 packages.config 修复此问题,或者保持原样。

添加nuget包之前,进入Tools-Options->NuGet Package Manager->General,将默认包管理格式更改为PackageReference .然后重新启动 Visual Studio,重新加载你的项目,添加那个包。

如果您仍然遇到相同的错误,请检查以下内容Troubleshooting

  • Use Package Manage Console to install the Microsoft.Azure.CosmosDB.Table package and its dependencies. To do
    this, type the following in the Package Manager Console for your
    solution.

    Install-Package Microsoft.Azure.CosmosDB.Table -IncludePrerelease

  • Using your preferred Nuget package management tool, install the Microsoft.Azure.Storage.Common Nuget package before installing
    Microsoft.Azure.CosmosDB.Table.

希望对您有所帮助。