TypeInitializationException was unhandled. The type initializer for ‘[datasource]‘ threw an exception.
December 22nd, 2009 — Brian FooteThis error message occurs in Windows Azure when the storage account is accessed from a Role that isn’t configured to read the published configuration settings. To fix this problem, add the following to the OnStart() method of the Worker Role (WorkerRole.cs) or Web Role (WebRole.cs) file:
// read storage account configuration settings
CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>
{
configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));
});
