Tuesday, July 1, 2008

How to detect which application server runs the ASP.NET code

Apart from issues with querying Google, I belive that the most reliable way to detect which application server runs an ASP.NET application is to check the SERVER_SOFTWARE variable available in Request.ServerVariables:

string server_software = this.Request.ServerVariables["SERVER_SOFTWARE"];
The integrated web server (aka Cassini) returns an empty string while the IIS seem to return a meaning value (Microsoft-IIS/5.1 on my XP machine). If there's more convenient way (I doubt) I would be glad if anyone would drop a note about it.

1 comment:

Anonymous said...

your site is very nice ...
this is very helpful and attractive.
visit for asp.net help asp.net help