6
votes

Can you programatically detect if the Development server in Visual Studio is used instead of IIS?

1
Is there a specific reason to do so? If you are merely trying to separate out environments, perhaps compilation flags would be better (i.e. DEBUG etc) - rifferte

1 Answers

7
votes

In Visual Studio 2010, Request.ServerVariables("SERVER_SOFTWARE") will return Nothing (null) for the Development Server, and "Microsoft-IIS/7.5" for my Win7 Pro IIS/VS2010 installation.