ImageResizer部署集成模式

ImageResizer deployment integrated mode

我在部署一个我用 ImageResizer 制作的小测试项目时遇到问题。

它基本上是最简单的版本,只有几个 html 页,然后是 ImageResizer 插件。

当我从 Visual Studio 2013 年 运行 它时它在本地工作,但是在发布到服务器之后我得到的只是一个 500 错误(即使启用了详细的错误消息)。

我也看不到 resizer.debug.ashx 页面,所以我猜这是一些非常基本的设置问题。

我的 web.config 文件看起来像这样(在 VS 和服务器上):

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="resizer" type="ImageResizer.ResizerSection,ImageResizer" />
  </configSections>

  <resizer>
    <!-- Unless you (a) use Integrated mode, or (b) map all reqeusts to ASP.NET, 
     you'll need to add .ashx to your image URLs: image.jpg.ashx?width=200&height=20 -->
    <pipeline fakeExtensions=".ashx" />

    <plugins>
      <!-- <add name="DiskCache" /> -->
      <!-- <add name="PrettyGifs" /> -->
    </plugins>
    <!--<sizelimits imageWidth="0" imageHeight="0" totalWidth="4096" totalHeight="4096" totalBehavior="throwexception"/>-->
  </resizer>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1"/>
  </system.web>  
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <!-- This is for IIS7+ Integrated mode -->
      <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/>
    </modules>
  </system.webServer>
</configuration>

我已验证服务器(windows 服务器 2012R2)上安装了 4.6.1,并且 IIS 8.5 应用程序池设置为集成 + .net CLR 版本 4.0.30319。

经典模式我也试过,但是也不行。

显然这是设置的基本内容,与 ImageResizer 没有任何关系。

可以找到问题的答案here(缺少为 IIS 服务器打开应用程序开发)