简体   繁体   English

从GAC配置托管的HTTP模块以在经典和集成模式下工作

[英]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. 我已经开发了一个自定义的托管HttpModule(.NET 2),将其安装在GAC上 ,并将其添加到IIS 8.5的“ Modules部分中。

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 ) . 对于每个具有集成模式的网站,此模块在其“模块”部分中都显示为Inherited ,并且按所有.NET 2和.NET 4 Web应用程序的设计工作(无需处理每个站点的Web.Config )。

As for websites in Classic mode , it's not there and therefore it's not accessible and working inside classic web application. 至于处于“ 经典”模式的网站,它不存在,因此无法访问并且无法在经典Web应用程序中运行。

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). 我尝试以任何方式编辑applicationHost.configWeb.Config (v2和v4),但没有任何结果(似乎Machine.Config没有位置)。

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? 如何以及在哪里可以全局注册同一模块以处理经典模式,而无需将dll添加到bin和/或编辑每个网站的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. 我编辑了C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Config\\machine.config ,但没有响应,因为IIS从64位框架读取配置,因此在C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Config\\machine.config添加模块C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Config\\machine.config解决了该问题。

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. 对于AppPools <.NET 4,也可以选择C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\CONFIG\\machine.configC:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\CONFIG\\machine.config也可以编辑。

For Integrated mode adding the custom module via IIS GUI to master Modules section is sufficient. 对于集成模式,通过IIS GUI将自定义模块添加到主模块部分就足够了。

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. 结果,可以在IIS,Integrated和Classic,32位和64位下的所有.NET 2.0 +网站访问一个安装在GAC上的自定义模块,而无需分别编辑每个网站的Web.Config。

This is useful especially for hostmasters and server administrators to monitor websites' activities (Errors, DDOS attacks, etc) without direct intervention. 这对于主机管理员和服务器管理员无需直接干预即可监视网站的活动(错误,DDOS攻击等)特别有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 集成的Windows身份验证如何真正起作用? - How does integrated windows authentication really work? 配置ASP.NET托管处理程序以处理-all-请求 - Configure ASP.NET Managed Handler to handle -all- requests 如何从经典的ASP页回收IIS应用程序池? - How to recycle an IIS Application pool from a classic ASP page? 无法从经典ASP站点中运行.NET MVC应用程序 - Difficulty running a .NET MVC Application from within a Classic ASP site 极端情况:您能否将 Net.Core 3.1 配置为在与 Asp.Classic 相同的文件夹中运行? - Edge case: Can you configure Net.Core 3.1 to run in the same folder as Asp.Classic? 如何将IIS应用程序配置为充当网关 - How to configure IIS application to work as a gateway ImageResizer部署集成模式 - ImageResizer deployment integrated mode IIS8:无法加载类型“System.ServiceModel.Activation.HttpModule” - IIS8: Could not load type 'System.ServiceModel.Activation.HttpModule' 将.NET项目从非托管ODP.NET程序集切换到托管ODP.NET程序集的问题 - Problems switching .NET project from unmanaged to managed ODP.NET assemblies 将经典ASP应用程序从2003 / IIS7迁移到2012 / IIS8 - Migrating a Classic ASP app from 2003/IIS7 to 2012/IIS8
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM