I'm trying to use Semantic Logging Application Block to store logs into Azure Table Storage. Setup:
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);
I'm getting a strange exception:
Exception thrown: 'System.MissingMethodException' in Microsoft.Practices.EnterpriseLibrary.SemanticLogging.WindowsAzure.dll
Additional information: Method not found: 'Void Microsoft.WindowsAzure.Storage.Table.CloudTableClient.set_RetryPolicy(Microsoft.WindowsAzure.Storage.RetryPolicies.IRetryPolicy)'.
I have the same issue with a real account. Packages versions (all of them are from NuGet):
- EnterpriseLibrary.SemanticLogging — 2.0.1406.1
- EnterpriseLibrary.SemanticLogging.WindowsAzure — 2.0.1406.1
- WindowsAzure.Storage — 7.0.0
How can I track the source of the exception? Google says nothing about the method that is not found. A project to test on your machine is here.
The reason you're getting this error is because
SLABis dependent on storage client library 3.0.2.0 (source) and settingRetry Policieson client (CloudTableClientfor example) was deprecated in version 4.0.0.0 (source) and removed in some later version (not sure which one).Because you're using version 7.x of storage client library, the method to set RetryPolicy on
CloudTableClientis not there and hence you're getting this error.