简体   繁体   中英

Could not load type 'Microsoft.WindowsAzure.CloudConfigurationManager'

I'm attempting to use an Elmah plugin for Azure Table Storage but this excepton is being thrown.

  [TypeLoadException: Could not load typ'Microsoft.WindowsAzure.CloudConfigurationManager' from assembly 'Microsoft.WindowsAzure.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
   Elmah.AzureTableStorage.ElmahHelper.GetConnectionString(IDictionary config) +0
   Elmah.AzureTableStorage.AzureTableStorageErrorLog..ctor(IDictionary config) +44

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +225
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1117
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +124
   System.Activator.CreateInstance(Type type, Object[] args) +21
   Elmah.SimpleServiceProviderFactory.CreateFromConfigSection(String sectionName) +202
   Elmah.ErrorLog.GetDefaultImpl(HttpContext context) +117
   Elmah.ServiceContainer.GetService(Type serviceType) +49
   Elmah.ServiceCenter.FindService(Object context, Type serviceType) +25
   Elmah.ServiceCenter.GetService(Object context, Type serviceType) +31
   Elmah.ErrorLog.GetDefault(HttpContext context) +22
   Elmah.ErrorPageBase.get_ErrorLog() +32
   Elmah.ErrorLogPage.OnLoad(EventArgs e) +313
   System.Web.UI.Control.LoadRecursive() +97
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,     Boolean 

I tried updating the relevant Azure packages via nuget but still getting this exception.

If you have installed the latest CloudConfigurationManager from nuget you likely have 3.1.0 installed. I clicked the link to the plugin above, it says there is an update that uses 3.1.0 so upgrading the plugin will likely fix your issue. Alternatively, check to see if you have an out of date binding redirect in the config file, or add one to reference the version of CloudConfigurationManager you have installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM