2016-05-11 3 views
1

Visual StudioからASP.Net MVC Webサイトを実行するとうまく動作しているNuGet経由でImageResizerがインストールされています。私は/resizer.debugページに行くことができ、それはすべてがうまくいると言います。ImageResizerはVisual Studioでテストするときに動作しますが、実稼働環境では動作しません。

Visual Studioから同じマシン上のメインIISインスタンスにサイトを公開すると、ImageResizerは機能せず、/ resizer.debugを参照すると404 Not Foundエラーが発生します。

私はweb.configを公開し、すべてのイメージリサイザコンポーネントがそこにあることを確認しました。例:

<httpModules><add name="ImageResizingModule" type="ImageResizer.InterceptModule" /></httpModules></system.web> 

ImageResizerのdllも/ binディレクトリにあります。

しかし、何も起こっておらず、デバッグページは表示されません。

プロジェクトの公開時にIIS7でImageResizerを設定する必要がありますか?

答えて

2

IIS7の統合モードではなく、IISクラシックのみに設定されているようです。 は、モジュールがインストールされた要素である必要があります。です。

From the installation guide

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
    <section name="resizer" type="ImageResizer.ResizerSection,ImageResizer" requirePermission="false" /> 
    </configSections> 

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

    <plugins> 
     <add name="DiskCache" /> 
     <!-- <add name="PrettyGifs" /> --> 
     <!-- <add name="SimpleFilters" /> --> 
     <!-- <add name="S3Reader" /> --> 
    </plugins> 
    </resizer> 

    <system.web> 
    <httpModules> 
     <!-- This is for IIS7/8 Classic Mode and Cassini--> 
     <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/> 
    </httpModules> 
    </system.web> 

    <system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules> 
     <!-- This is for IIS7/8 Integrated mode --> 
     <add name="ImageResizingModule" type="ImageResizer.InterceptModule"/> 
    </modules> 
    </system.webServer> 
</configuration> 
関連する問題