【发布时间】:2013-10-23 15:44:10
【问题描述】:
我有一个诊断网页,我需要确保该网站以编程方式在 ASP.NET 中安装在正确的应用程序池版本上。
我在 Windows 7 下运行 IIS 7.5,但代码也必须在 Windows Server 2008 R2 下运行。
我知道如何通过这两种方式获取 App Pool 名称:
// First way to do it
string name = System.Environment.GetEnvironmentVariable("APP_POOL_ID", System.EnvironmentVariableTarget.Process);
// Second way to do it
string name = HttpContext.Current.Request.ServerVariables["APP_POOL_ID"];
但是,从那里,我不知道如何获取 App Pool 版本。我查看了很多网页和论坛,但我找不到答案。 有人可以帮忙吗?
【问题讨论】:
-
完整 诊断网页 ?
标签: c# asp.net iis iis-7 iis-8