本文介绍了Imageresizer.AzureReader2不符合最新的Azure SDK 2.1.0.3工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个ASP.NET MVC应用5,我已经升级到最新的SDK 2.1.0.3,它好像已经ImageResizer炸毁。是否有任何变通?以下是详细信息:
=== pre-绑定状态信息===
日志:显示名称= Microsoft.WindowsAzure.Storage,版本= 2.1.0.0,文化=中性公钥= 31bf3856ad364e35
(完全指定)
LOG:应用平台= XXX
LOG:初始PrivatePath = XXX
调用汇编:ImageResizer.Plugins.AzureReader2,版本= 3.4.0.763,区域性=中性公钥=空。
===
日志:此绑定的默认加载上下文开始。
日志:正在使用应用程序配置文件:X
日志:使用主机配置文件:X
日志:从X使用计算机配置文件
日志:后政策参考:Microsoft.WindowsAzure.Storage,版本= 2.1.0.0,文化=中性公钥= 31bf3856ad364e35
日志:新的URL文件试图下载:/// C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET文件/根/ 6038b9fb / 8488b4a1 / Microsoft.WindowsAzure.Storage.DLL。
日志:尝试新的URL文件下载:/// C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET文件/根/ 6038b9fb / 8488b4a1 / Microsoft.WindowsAzure.Storage / Microsoft.WindowsAzure.Storage .DLL。
日志:新的URL x的尝试下载
警告:比较程序集名称时发生不匹配:修订号
错误:未能完成组装(HR = 0x80131040)的设置。探测终止。[FileLoadException:未能加载文件或程序集Microsoft.WindowsAzure.Storage,版本= 2.1.0.0,文化=中性公钥= 31bf3856ad364e35或它的一个依赖。找到的程序集清单定义不匹配程序集引用。 (异常来自HRESULT:0x80131040)]
ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider..ctor(字符串blobStorageConnection)+ 0
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin.Install(配置C)379
ImageResizer.Configuration.PluginConfig.add_plugin_by_name(字符串名称,NameValueCollection中参数)+275
ImageResizer.Configuration.PluginConfig.loadPluginsInternal()+402
ImageResizer.Configuration.PluginConfig.LoadPlugins()+102
ImageResizer.Configuration.Config..ctor(ResizerSection配置)+546
ImageResizer.Configuration.Config.get_Current()+115
ImageResizer.InterceptModule.get_conf()+36
ImageResizer.InterceptModule.System.Web.IHttpModule.Init(HttpApplication的上下文)+250
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr的appContext,HttpContext的背景下,MethodInfo的[]处理程序)418
System.Web.HttpApplication.InitSpecial(HttpApplicationState状态,MethodInfo的[]处理器,IntPtr的appContext,HttpContext的背景下)+172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr的appContext,HttpContext的背景下)336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr的appContext)296[HttpException(0x80004005的):未能加载文件或程序集Microsoft.WindowsAzure.Storage,版本= 2.1.0.0,文化=中性公钥= 31bf3856ad364e35或它的一个依赖。找到的程序集清单定义不匹配程序集引用。 (异常来自HRESULT:0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext的背景下)9874840
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext的背景下)+101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest WR,HttpContext的背景下)+254
解决方案
如果您尝试添加-BindingRedirect
键,它可以让你无处(它没有添加正确重定向对我来说)你需要添加以下到您的的Web.Config
<&运行GT;
< assemblyBinding的xmlns =瓮:架构 - 微软COM:asm.v1> <! - 在这里其他的绑定! - > < dependentAssembly>
< assemblyIdentity名称=Microsoft.WindowsAzure.Storage公钥=31bf3856ad364e35文化=中性/>
< bindingRedirect oldVersion =0.0.0.0-2.1.0.3NEWVERSION =2.1.0.3/>
< / dependentAssembly>
< / assemblyBinding>
I have an ASP.NET MVC 5 application and I've upgraded to the latest SDK 2.1.0.3 and it seems as though ImageResizer has blown up. Are there any work arounds? Here is the details:
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = xxx
LOG: Initial PrivatePath = xxx
Calling assembly : ImageResizer.Plugins.AzureReader2, Version=3.4.0.763, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: x
LOG: Using host configuration file: x
LOG: Using machine configuration file from x
LOG: Post-policy reference: Microsoft.WindowsAzure.Storage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/6038b9fb/8488b4a1/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/6038b9fb/8488b4a1/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL x
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
[FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
ImageResizer.Plugins.AzureReader2.AzureVirtualPathProvider..ctor(String blobStorageConnection) +0
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin.Install(Config c) +379
ImageResizer.Configuration.PluginConfig.add_plugin_by_name(String name, NameValueCollection args) +275
ImageResizer.Configuration.PluginConfig.loadPluginsInternal() +402
ImageResizer.Configuration.PluginConfig.LoadPlugins() +102
ImageResizer.Configuration.Config..ctor(ResizerSection config) +546
ImageResizer.Configuration.Config.get_Current() +115
ImageResizer.InterceptModule.get_conf() +36
ImageResizer.InterceptModule.System.Web.IHttpModule.Init(HttpApplication context) +250
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9874840
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
解决方案
If you try Add-BindingRedirect
and it gets you nowhere (it didn't add the right redirect for me) you need to add the following into your Web.Config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- Other bindings here! -->
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.1.0.3" newVersion="2.1.0.3"/>
</dependentAssembly>
</assemblyBinding>
这篇关于Imageresizer.AzureReader2不符合最新的Azure SDK 2.1.0.3工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!