我正在尝试使用Semantic Logging Application Block
将日志存储到Azure Table Storage
. 设置:
ObservableEventListener listener1 = new ObservableEventListener();
var conString =
$"DefaultEndpointsProtocol={CloudStorageAccount.DevelopmentStorageAccount.TableEndpoint.Scheme};" +
$"AccountName={CloudStorageAccount.DevelopmentStorageAccount.Credentials.AccountName};" +
$"AccountKey={Convert.ToBase64String(CloudStorageAccount.DevelopmentStorageAccount.Credentials.ExportKey())}";
listener1.LogToWindowsAzureTable( // <---- EXCEPTION HERE
instanceName: "instName",
connectionString: conString);
我遇到了一个奇怪的例外:
抛出异常:Microsoft.Practices.EnterpriseLibrary.SemanticLogging.WindowsAzure.dll 中的“System.MissingMethodException”
附加信息:找不到方法:'无效 Microsoft.WindowsAzure.Storage.Table.CloudTableClient.set_RetryPolicy(Microsoft.WindowsAzure.Storage.RetryPolicies.IRetryPolicy)'。
我的真实账户也有同样的问题。包版本(全部来自 NuGet):
- EnterpriseLibrary.SemanticLogging — 2.0.1406.1
- EnterpriseLibrary.SemanticLogging.WindowsAzure — 2.0.1406.1
- WindowsAzure.Storage — 7.0.0
如何跟踪异常的来源?谷歌对未找到的方法只字未提。在您的机器上测试的项目在这里。