简体   繁体   中英

Configure managed httpmodule from GAC to work both in Classic and Integrated modes

I've developed a custom managed HttpModule (.NET 2), installed it on GAC and added it in Modules section for IIS 8.5 globally.

For each website with Integrated mode this module is visible in it's Modules section as Inherited and it works as designed for all .NET 2 and .NET 4 web applications (without manipulating each site's Web.Config ) .

As for websites in Classic mode , it's not there and therefore it's not accessible and working inside classic web application.

I tried editing applicationHost.config and Web.Config (v2 and v4) in any way but I got no result (It seems Machine.Config has no place for it).

How and where can I globally register that same module to handle classic mode without adding dll to bin and/or editing each website's Web.Config?

OK it works now. For future reference:

I edited C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Config\\machine.config and got no response because IIS reads config from 64bit framework, so adding module inside C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Config\\machine.config solved the problem.

Alternatively for AppPools < .NET 4, C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\CONFIG\\machine.config and C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\CONFIG\\machine.config must also be edited.

For Integrated mode adding the custom module via IIS GUI to master Modules section is sufficient.

As the result, one custom module installed on GAC is accessible for all .NET 2.0 + websites under IIS, Integrated and Classic, 32bit and 64bit with no need to edit each website's Web.Config separately.

This is useful especially for hostmasters and server administrators to monitor websites' activities (Errors, DDOS attacks, etc) without direct intervention.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM