0

私の web.config<system.webServer>セクションで、カスタム モジュールを追加します。

<modules>
    <add name="MyCustomModule" type="MyAssembly.MyCustomModule, MyAssembly" />
</modules>

次に、HTTP ハンドラーでモジュール リストを反復処理します。

var allModules = HttpContext.Current.ApplicationInstance.Modules;
for( int i = 0; i < allModules.Count; i++ ) {
    Trace(allModules.GetKey(i));
}

そして、私はこのリストを取得します:

__ASP_IntegratedDynamicModule_Shim
OutputCache
Session
FormsAuthentication
DefaultAuthentication
RoleManager
AnonymousIdentification
Profile
UrlMappingsModule
ServiceModel-4.0
UrlRoutingModule-4.0
ScriptModule-4.0
MyCustomModule <<<<<<<<<<<<<My Module
__DynamicModule_System.Web.WebPages.WebPageHttpModule, System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35_2d022434-c92d-4088-bfa6-3478c4fc129d

明らかに、私のモジュールはすべての組み込みモジュールの後に登録されますが、WebPageHttpModule はその後に登録されます。

それはどのように起こりますか?自分のモジュールが最後に登録されるようにするにはどうすればよいですか?

4

1 に答える 1