我在 ASP.NET MVC 4 项目中使用ImageResizer模块,以及插件 SqlReader 和 MvcRoutingShim。
当我尝试访问 URL ~/databaseimages/123.jpg
(例如)时,我只是得到标准错误404 - The resource cannot be found.
我的期望是 ImageResizer 会处理该请求并尝试从数据库中读取图像,但它甚至不尝试连接(我使用 SQL Profiler 来验证这一点)。
有什么问题?
这是 /resizer.debug 的输出:
Image resizer diagnostic sheet 26-06-2012 20:42:57
1 Issues detected:
(Warning): To potentially see additional errors here, perform an image resize request.
You are using paid bundles: Cloud Bundle, Performance Bundle
Registered plugins:
ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.MvcRoutingShim.MvcRoutingShimPlugin
ImageResizer.Plugins.SqlReader.SqlReaderPlugin
ImageResizer.Plugins.DiskCache.DiskCache
Configuration:
<resizer>
<plugins>
<add name="MvcRoutingShim" />
<add name="SqlReader" prefix="~/databaseimages/" connectionString="database" idType="UniqueIdentifier" blobQuery="SELECT Content FROM Images WHERE ImageID=@id" modifiedQuery="Select ModifiedDate, CreatedDate From Images WHERE ImageID=@id" existsQuery="Select COUNT(ImageID) From Images WHERE ImageID=@id" requireImageExtension="false" cacheUnmodifiedFiles="true" extensionPartOfId="false" vpp="true" untrustedData="false" />
<add name="DiskCache" />
</plugins>
</resizer>
(...)