How can I know under which IIS version my Asp.Net application is running?

.net, asp.net, frameworks

Solution

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.

Problem

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,4.0 have support built in IIS.... Thanks

Original source