2011-01-11 6 views
0

クラシックモードでIIS7でasp.netアプリケーションを実行しました。 私はすでにISAPIモジュールを「*」にスクリプトマッピングを作成しましたが、私は(それがない存在していても)、TXT、要求を実行するときに私は404エラーを取得:ASP.NETで* .txtリクエストを処理する方法

通知MapRequestHandler

ハンドラStaticFile

、Global.asaxまたはモジュールでイベントが発生しません。 私は何かを忘れましたか?

おそらく StaticFileハンドラ削除する必要が
<system.web> 
... 
<httpHandlers> 
    <add verb="*" path="*" validate="false" type="TestCustomExtensions.TextFileHandler, TestCustomExtensions" /> 
</httpHandlers> 
<httpModules> 
    <add name="text" type="TestCustomExtensions.TextModule"/> 
</httpModules> 
</system.web> 

<system.webServer> 
... 
<modules> 
    <add name="textModule" type="TestCustomExtensions.TextModule"/> 
</modules> 
<handlers> 
    <add name="TextFiles" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" /> 
</handlers> 
,</system.webServer> 
+0

あなたが –

+0

でIISでハンドラを登録しました – Madman

答えて

0

解決済み!

私のOSに問題がありました。私は64xウィンドウがインストールされているが、設定ファイルでは私はISAPI dllに32xパスを設定します。ですから、これを解決するために、私は32xと64x両方のOSを扱うために2行を追加しました。

<add name="TestFiles64" path="*.txt" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" /> 
<add name="TextFiles32" path="*.txt" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" /> 
1

:(HTTPハンドラの順序が重要である)以下のことを試してみてください

<handlers> 
    <remove name="StaticFile" /> 
</handlers> 

UPDATE

を:

<handlers> 
    <remove name="StaticFile" /> 

    <add name="TextFiles" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" /> 
    <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" 
    resourceType="Either" requireAccess="Read" /> 
</handlers> 
+0

を参照してくださいが、その後StaticFileModule、DefaultDocumentModuleとして、DirectoryListingModuleが動作しません、確かハンドラマッピング部 – Madman

関連する問題