【问题标题】:AzureReader2 gives me a 400 Bad request when enabledAzureReader2 在启用时给我一个 400 Bad request
【发布时间】:2015-06-23 08:03:51
【问题描述】:

我的网站在打开了 ImageResizer、AzureReader2 和 DiskCache 的 Azure 上运行。当我对实时网站进行编辑和部署更改时,我在网站上收到 400 Bad request 错误。如果我在 Web.config 中禁用 AzureReader2,页面会完美显示,但显然缺少图像。当我启用 AzureReader2 时,我之前在 AzureReader2 关闭时浏览的页面可以完美地与按预期调整大小的图像一起工作,但是未浏览的页面给我一个 400 Bad 请求。我已经寻找了一天半的解决方案,但我没有找到任何解决这个问题的方法。关于如何永久解决这个问题的任何想法都很棒!谢谢。

这里是测试网站:http://iwktest.azurewebsites.net/

Here's my diagnostics page:
Image resizer diagnostic sheet      6/23/2015 11:16:33 AM

0 Issues detected:


You are using plugins from the Performance Edition: DiskCache (Performance Edition), AzureReader2Plugin (Performance Edition)

Registered plugins:

ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.DiskCache.DiskCache
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin

Configuration:

<resizer>
<pipeline fakeExtensions=".ashx" />
<plugins>
<add name="DiskCache" />
<add name="AzureReader2" connectionString="[redacted]" endpoint="http://iwkimages.blob.core.windows.net/" prefix="~/" />
</plugins>
</resizer>


Accepted querystring keys:

quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom, 

Accepted file extensions:

bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi, 

Environment information:

Running Microsoft-IIS/8.0 on Microsoft Windows NT 6.2.9200.0 and CLR 4.0.30319.36213
Trust level: Unrestricted
OS bitness: x86 !! Warning, running as 32-bit on a 64-bit OS(AMD64). This will limit ram usage !!
Executing assembly: D:\Windows\SysWOW64\inetsrv\w3wp.exe
IntegratedPipeline: True

Loaded assemblies:

mscorlib                                 Assembly: 4.0.0.0         File: 4.0.30319.36213 Info: 4.0.30319.36213
System.Web                               Assembly: 4.0.0.0         File: 4.0.30319.36283 Info: 4.0.30319.36283
System                                   Assembly: 4.0.0.0         File: 4.0.30319.34239 Info: 4.0.30319.34239
System.Core                              Assembly: 4.0.0.0         File: 4.0.30319.36213 Info: 4.0.30319.36213
System.Web.ApplicationServices           Assembly: 4.0.0.0         File: 4.0.30319.34248 Info: 4.0.30319.34248
System.Configuration                     Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Xml                               Assembly: 4.0.0.0         File: 4.0.30319.36241 Info: 4.0.30319.36241
System.Runtime.Caching                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.Build.Utilities.v4.0           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.Web.Compilation.Snapshots      Assembly: 1.0.0.0         File: 1.1.0.0        
Microsoft.JScript                        Assembly: 10.0.0.0        File: 11.0.50709.17929 Info: 11.0.50709.17929
EnvSettings                              Assembly: 1.0.0.0         File: 46.0.8598.1007  Info: 46.0.8598.1007 (rd_websites_stable.150620-0845)
System.Web.WebPages.Deployment           Assembly: 1.0.0.0         File: 1.0.20105.407  
App_Code.tneplgwm                        Assembly: 0.0.0.0        
System.Data                              Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
App_global.asax.wwlyy9nh                 Assembly: 0.0.0.0        
System.Web.Extensions                    Assembly: 4.0.0.0         File: 4.0.30319.34248 Info: 4.0.30319.34248
System.ServiceModel.Activation           Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
Microsoft.CSharp                         Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.Services                      Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Drawing                           Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.EnterpriseServices                Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.IdentityModel                     Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.Runtime.Serialization             Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.ServiceModel                      Assembly: 4.0.0.0         File: 4.0.30319.36241 Info: 4.0.30319.36241
System.ServiceModel.Web                  Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Activities                        Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.ServiceModel.Activities           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.WorkflowServices                  Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Data.DataSetExtensions            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xml.Linq                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.ComponentModel.DataAnnotations    Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.DynamicData                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
ASPnetPagerV2_8                          Assembly: 2.8.3227.25225  File: 2.8.0.0        
Hyak.Common                              Assembly: 1.0.0.0         File: 1.0.2.0        
ImageResizer                             Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.AzureReader         Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.AzureReader2        Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.DiskCache           Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
Microsoft.Azure.Common                   Assembly: 2.0.0.0         File: 2.1.0.0        
Microsoft.Azure.Common.NetFramework      Assembly: 2.0.0.0         File: 2.1.0.0        
Microsoft.Azure.KeyVault.Core            Assembly: 0.9.0.0         File: 0.9.1.0        
Microsoft.Azure.Management.Sql           Assembly: 0.9.0.0         File: 0.29.0.0       
Microsoft.Data.Edm                       Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
Microsoft.Data.OData                     Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
Microsoft.Data.Services.Client           Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
Microsoft.Threading.Tasks                Assembly: 1.0.12.0        File: 1.0.168.0       Info: 1.0.168.0
Microsoft.Threading.Tasks.Extensions.Desktop Assembly: 1.0.168.0       File: 1.0.168.0       Info: 1.0.168.0
Microsoft.Threading.Tasks.Extensions     Assembly: 1.0.12.0        File: 1.0.168.0       Info: 1.0.168.0
Microsoft.WindowsAzure.Configuration     Assembly: 2.0.0.0         File: 2.0.2.0        
Microsoft.WindowsAzure.Storage           Assembly: 2.1.0.3         File: 2.1.0.3        
Microsoft.WindowsAzure.StorageClient     Assembly: 1.7.0.0         File: 6.0.6002.18488 
Newtonsoft.Json                          Assembly: 6.0.0.0         File: 6.0.8.18111    
System.IO                                Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net.Http                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net.Http.Extensions               Assembly: 2.2.22.0        File: 2.2.22.0        Info: 2.2.22.0
System.Net.Http.Primitives               Assembly: 2.2.22.0        File: 2.2.22.0        Info: 2.2.22.0
System.Net.Http.WebRequest               Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Runtime                           Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Spatial                           Assembly: 5.6.2.0         File: 5.6.2.61936     Info: 5.6.2.61936
System.Threading.Tasks                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net                               Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.Transactions                      Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
System.ServiceModel.Internals            Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
Microsoft.WindowsAzure.ServiceRuntime    Assembly: 2.6.0.0         File: 2.6.1198.712    Info: 2.6.1198.712 (rd_art_stable.150223-1353)
msshrtmi                                 Assembly: 2.6.0.0        
Microsoft.WindowsAzure.WebSites.Diagnostics Assembly: 1.0.0.0         File: 46.0.8598.1007  Info: 46.0.8598.1007 (rd_websites_stable.150620-0845)
Microsoft.Azure.Websites.StorageSdk      Assembly: 4.1.0.0         File: 4.1.0.0        
System.Web.RegularExpressions            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
SMDiagnostics                            Assembly: 4.0.0.0         File: 4.0.30319.34230 Info: 4.0.30319.34230
System.Xaml.Hosting                      Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xaml                              Assembly: 4.0.0.0         File: 4.0.30319.34209 Info: 4.0.30319.34209
App_Web_3ugoikon                         Assembly: 0.0.0.0        
App_Web_hb2au1pk                         Assembly: 0.0.0.0        
App_Web_g5nsnuqc                         Assembly: 0.0.0.0        
App_Web_dzoq4fux                         Assembly: 0.0.0.0        
App_Web_wikwjgud                         Assembly: 0.0.0.0        
App_Web_jpawolt0                         Assembly: 0.0.0.0        
App_Web_i1ekkccj                         Assembly: 0.0.0.0        
App_Web_xk1ukx11                         Assembly: 0.0.0.0        
App_Web_iciotjon                         Assembly: 0.0.0.0        
App_Web_io0d5en1                         Assembly: 0.0.0.0        
System.Web.Mobile                        Assembly: 4.0.0.0         File: 4.0.30319.34248 Info: 4.0.30319.34248
App_Web_fldm00ds                         Assembly: 0.0.0.0        
App_Web_jmu24pv1                         Assembly: 0.0.0.0        
System.Data.Services.Client              Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929

The following plugin assemblies are loaded but do not seem to be in use. You should remove them (and especially their dependencies (unless used elsewhere)) from the /bin folder to improve application load times:

ImageResizer.Plugins.AzureReader         Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7

Reference list of plugin dependencies - so you know what additional dlls to remove when removing a plugin. (may not be up-to-date, see plugin docs):

The FreeImage plugin has the following dependencies: FreeImage.dll and FreeImageNET.dll
The Logging plugin depends on: NLog.dll
The AdvancedFilters, RedEye, and WhitespaceTrimmer plugins depend on: AForge.dll, AForge.Math.dll, and AForge.Imaging.dll
The PsdReader and PsdComposer plugins depend on: PsdFile.dll
The S3Reader plugin depends on: LitS3.dll
The BatchZipper plugin depends on: Ionic.Zip.Reduced.dll
The PdfRenderer plugin depends on gsdll32.dll or gdsll32.dll
The RedEye plugin depends on several dozen files... see the plugin docs.

这是 web.config 文件的一瞥

<plugins>
      <!-- For Image resizer image caching -->
      <add name="DiskCache" />
      <!-- Azure Blob reader   -->
      <add name="AzureReader2" connectionString="DefaultEndpointsProtocol=https;AccountName=iwkimages;AccountKey=******" endpoint="http://iwkimages.blob.core.windows.net/" prefix="~/" />
    </plugins>

【问题讨论】:

    标签: azure imageresizer


    【解决方案1】:

    此错误表示Microsoft.WindowsAzure.StorageClient 1.7.0.0 正在向 Azure 服务器发出无效请求。您应该升级到 2.1 或更高版本,因为 Microsoft 不再支持较旧的 Azure 库。

    【讨论】:

    • 嗨 Nathanael,我尝试寻找更高版本,但我得到的只是 Microsoft.WindowsAzure.Storage,我升级到版本 4.3.0.0 但没有运气,它仍然显示 Microsoft.WindowsAzure.StorageClient 为版本 1.7.0.0。有关如何更新此内容的任何提示。谢谢!
    • ImageResizer v4 需要最新的 Azure 库,并将强制升级;如果您无法通过 NuGet 升级,您可以尝试该路线。
    • 嗨 Nathanel,听起来不错。 ImageResizer v4 什么时候出。我当前的许可证对 ImageResizer v4 仍然有效吗?
    • 这篇文章说 Microsoft.WindowsAzure.StorageClient 程序集已被 Microsoft.WindowsAzure.Storage 程序集取代。 stackoverflow.com/questions/14442691/…
    • 您好 Rohan,您的许可证适用于 v4;我们于 2015 年 5 月 1 日停止销售 v3。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-08
    • 1970-01-01
    • 2011-08-31
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    相关资源
    最近更新 更多