How to Find IIS Version With ASP.NET Code?
Although .Net Framework in general gives you uniform run-time environment on different operating systems, some things works differently. For example, if you try to implement URL rewriting or ASP.NET routing, code will return just an error 404 - Page Not Found on earlier versions of IIS.
To find out which version of IIS hosts your web application, you can use SERVER_SOFTWARE from Request.ServerVariables collection, with code like this:
[ C# ]
[ VB.NET ]
This code line will return output with server name and version, for example:
1. How To Get Server Computer Name?