Last active
August 29, 2015 14:01
-
-
Save nnasaki/6f10c9eb0f8c3bc90242 to your computer and use it in GitHub Desktop.
Microsoft.WindowsAzure.Management raise System.IO.FileNotFoundException
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
型 'System.IO.FileNotFoundException' のハンドルされていない例外が azuremanagement.exe で発生しました | |
追加情報:ファイルまたはアセンブリ 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'、またはその依存関係の 1 つが読み込めませんでした。指定されたファイルが見つかりません。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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