Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nnasaki/6f10c9eb0f8c3bc90242 to your computer and use it in GitHub Desktop.
Save nnasaki/6f10c9eb0f8c3bc90242 to your computer and use it in GitHub Desktop.
Microsoft.WindowsAzure.Management raise System.IO.FileNotFoundException
型 'System.IO.FileNotFoundException' のハンドルされていない例外が azuremanagement.exe で発生しました
追加情報:ファイルまたはアセンブリ 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'、またはその依存関係の 1 つが読み込めませんでした。指定されたファイルが見つかりません。
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Management.WebSites;
using Microsoft.WindowsAzure.Management.WebSites.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace azuremanagement
{
class Program
{
static void Main(string[] args)
{
var subscriptionId = "xxxxx";
var base64Certificate = "xxxx";
var credentials = new CertificateCloudCredentials(subscriptionId, new X509Certificate2(Convert.FromBase64String(base64Certificate)));
using (var client = new WebSiteManagementClient(credentials))
{
var spaces = client.WebSpaces.List();
foreach (var space in spaces)
{
Console.WriteLine("Space: {0}", space.Name);
var sites = client.WebSpaces.ListWebSites(space.Name, new WebSiteListParameters { PropertiesToInclude = { "Name" } });
foreach (var site in sites)
{
Console.WriteLine(" " + site.Name);
}
}
}
}
}
}
https://github.com/Azure/azure-sdk-for-net/issues/464
> Installing "Microsoft Async" (Microsoft.Bcl.Async) nuget package mysteriously solves this error and client works as expected.
ということで、Nugetから以下を実行したら例外が起きなくなった。
PM> Install-Package Microsoft.Bcl.Async azuremanagement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment