How can I know under which IIS version my web application is running in development server?
As .Net framework 2.0,3.0,3.5 have support built in IIS....
Thanks
views:
984answers:
3
+3
A:
@AnthonyWJones "So the question becomes, How does an ASP.NET application determine what operating system it is running on?"
You can use System.Environment.OSVersion
DoctaJonez
2009-07-01 11:31:39
+4
A:
To get the IIS version of the webserver you can use the SERVER_SOFTWARE server variable.
Request.ServerVariables["SERVER_SOFTWARE"];
It will return something like as follows:
Microsoft-IIS/5.0 (Windows 2000)
Microsoft-IIS/5.1 (Windows XP)
Microsoft-IIS/6.0 (Windows 2003 Server)
You can find a full reference of server variables here.
DoctaJonez
2009-07-01 11:36:25
this return empty string in development server....
Muhammad Akhtar
2009-07-01 12:39:44
+3
A:
This is available directly from the SERVER_SOFTWARE
server variable:
HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"];
which is a string like "Microsoft-IIS/7.0
".
NB, the string is empty for the ASP.NET development server ("Casini").
Richard
2009-07-01 11:37:24
Using the development server => not using IIS, so the question does not apply.
Richard
2009-07-01 16:46:50