How to programatically detect if my application is running in IIS 7.0 Integrated mode from within an ASP.NET page

馋奶兔 提交于 2019-12-05 05:00:14

Look at ApplicationPool.ManagedPipelineMode and ServerManager.ApplicationPools Properties. So you can examine ApplicationPool.ManagedPipelineMode of the current AppPool about like this example do, but to do this for ApplicationPool of your application and not for the default application domain like the example do. The ServerManager.ApplicationPools contain all pools including yours one.

I found a way in .NET 4.0 to do this without referencing the Microsoft.Web.Administration assembly. The System.Web.HttpRuntime class has the UsingIntegratedPipeline boolean property.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!