azure - azure SDK 缺少 Microsoft.Threading.Tasks

标签 azure azure-sdk-.net

我正在尝试使用 Microsoft Azure SDK for .net版本 0.9.5-预览版。我基本上试图从自述文件中获取列出位置和服务的示例。但是我遇到了异常

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.WindowsAzure.Management.dll

Additional information: Could not load file or assembly 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

有关此程序集的信息非常稀疏。我发现了一些与 PCL 和 Windows Phone 相关的引用资料,但这只是一个使用完整 4.5.1 的控制台应用程序(尽管我也尝试过 4.5)。

我在 google repository 中找到了该 dll 的副本将其放入 bin 目录中确实可以使应用程序正常工作,但这似乎是一个壮观的黑客攻击。我宁愿看到更好的解决方案。有什么想法吗?

packages.config 内容为

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.WindowsAzure.Common" version="0.9.8-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management" version="0.9.5-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.Compute" version="0.9.9-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.Libraries" version="0.9.6-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.Monitoring" version="0.9.2-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.Scheduler" version="0.9.8-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.ServiceBus" version="0.9.3-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.Sql" version="0.9.4-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.Storage" version="0.9.3-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.VirtualNetworks" version="0.9.3-preview" targetFramework="net45" />
  <package id="Microsoft.WindowsAzure.Management.WebSites" version="0.9.3-preview" targetFramework="net45" />
</packages>

最佳答案

您缺少的

Microsoft.Threading.Tasks 程序集位于 Microsoft.Bcl.Async NuGet 包中。不知道为什么,但您的 packages.config 文件缺少一堆依赖程序集。您可能需要卸载并重新安装 NuGet 包以恢复依赖项。

关于azure - azure SDK 缺少 Microsoft.Threading.Tasks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21762563/

相关文章:

Azure DevOps 托管代理上的 Azure 功能包?

azure - Azure 平台上使用哪个版本的 Azure SDK?

c# - Azure 服务总线 AutoDeleteOnIdle

windows - 为什么 GetEnvironmentVariable() 在 Windows Azure 中为我的 RoleRoot 返回错误的目录?

azure - 使用 cspack.exe 创建 Azure 云包时出现缺少缓存文件错误

azure - 调用 Azure WebSiteManagementClient GetConfiguration 时 AppSettings 未返回

azure - 无法在创建知识库向导中选择 QnA 服务

c# - 文档数据库请求连续 token 在第一次迭代时未设置

Azure 数据工厂管道成本

azure - 将 Sitefinity 6.3(Windows Azure Webproject)升级到 Sitefinity 7.0 后出现问题