カスタムHTTPハンドラを使用してASP.Net Webアプリケーションを作成しました。アプリが起動されたときしかし、IIS 7.5にアプリケーションをインポートした後、IISはこれを返します。HTTP 405エラーを防ぐためにIISのDirectoryListingModuleを無効または削除する方法
HTTP/1.1 405 Method Not Allowed
私はルールを失敗した要求トレースを有効にすると、トラップHTTPに私はこれを参照してください405エラーを備えています:
ハンドラが呼び出されません。だから私はDirectoryListingModuleを削除したいと思います。しかし、@Brendan Hill hereに似て、私が試したことは何もモジュールを無効にするようだ。でもCでこのモジュールを言及するすべての行をコメントアウト:\ Windowsの\ system32 \ inetsrv \ config \にあるapplicationHost.configは動作しません:
<!--add name="DirectoryListingModule" image="%windir%\System32\inetsrv\dirlist.dll" /-->
<!--add name="DirectoryListingModule" lockItem="true" /-->
<!--add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" /-->
同様@Brendanヒル私は私のアプリのWebでのソリューションを好むだろう.configなので、私はIISの設定で悩む必要はありません。私の現在のWeb.configからの抜粋:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<handlers>
<remove name="WebDAV" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="AuthServiceHandler"
path="*."
verb="*"
type="AuthServiceHTTPHandler.App_Code.AuthServiceHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
私はIISの既定のWebサイトに私のアプリをインポートし、9000にバインドした場合、私はhttp://localhost:9000へのPOSTリクエストでアプリを起動することができます。このURLは問題ありません。私はどんなウェブページも要求しようとしていない。私は、私が興味を持ったダミーのWebページを作成し、POST動詞の場合とハンドラを結合することによって問題を回避働いた末に