在RELEASE模式下部署到Azure网站时,使用AzureReader2的ImageResizer会为调整大小的图像返回404

时间:2015-02-01 14:23:43

标签: azure-storage azure-web-sites imageresizer

我有一个MVC网站(MVC 5.2.2.0),它使用ImageResizer和Azure Blob存储,使用AzureReader2 plugin

我正在使用默认设置,因此图像将通过/ azure / images(其中“images”是我的容器的名称)进行访问,并且它在开发中完美运行 - 如果我使用 调试 设置。

如果我使用 发布 设置进行部署,则图片会停止工作并返回带有新罗马文字次数的404s“您要查找的资源已被删除,名称已有已更改或暂时不可用。“,如下所示。

enter image description here

这是来自我的web.config,并且在发布时没有修改(我仔细检查过):

<resizer>
 <plugins>
  <add name="MvcRoutingShim" />
  <add name="AzureReader2" connectionString="DefaultEndpointsProtocol=http;AccountName=[accountname];AccountKey=[KEY]" endpoint="http://[account].blob.core.windows.net/" />
  <add name="DiskCache" />
 </plugins>
</resizer>

我迷路了,不知道从哪里开始排除故障。我试过禁用DiskCache插件,这没什么区别。

1 个答案:

答案 0 :(得分:1)

这很可能是因为您的配置在切换到发布模式时启用了预编译。禁用预编译应允许VirtualPathProviders再次工作。

有关详细信息,请参阅"File Not Found - cause #4" in the Troubleshooting Guide

相关问题