Determining IIS version

  • Thread starter Thread starter Mike Schilling
  • Start date Start date
M

Mike Schilling

Is there any way, inside an ASP.NET application, to determine what version
of IIS you're running in? (Or even if you're running in IIS; there was
talk, some time ago, about porting ASP.NET to other web servers.) I've
looked at the System.Web classes without finding a property or method that
allows this. (People who've done Java servlets will know I'm looking for an
analogue to ServletContext.getServerInfo() )
 
Mike said:
Is there any way, inside an ASP.NET application, to determine what version
of IIS you're running in? (Or even if you're running in IIS; there was
talk, some time ago, about porting ASP.NET to other web servers.) I've
looked at the System.Web classes without finding a property or method that
allows this. (People who've done Java servlets will know I'm looking for an
analogue to ServletContext.getServerInfo() )
All of the settings for ISS are in the registry I would start looking there.

JB
 
Since IIS is bound to Windows, you might want to check for the Windows
version string inside System.Environment class. For example, if you find Win
XP, you are running IIS 5.1, Win 2k3 means IIS 6 and so on
 
Sriram Krishnan said:
Since IIS is bound to Windows, you might want to check for the Windows
version string inside System.Environment class. For example, if you find Win
XP, you are running IIS 5.1, Win 2k3 means IIS 6 and so on

Of course, if my stuff ever runs on ASP.NET hosted inside Apache, or on Mono
on a Linux box, I'm out of luck.

Thanks for the help, but there really should be a programmtic interface for
this sort of thing.
 
Back
Top