Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect development server in asp.net (Visual Studio)

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

like image 256
ciscoheat Avatar asked Aug 17 '10 08:08

ciscoheat


People also ask

What is Visual Studio development server?

The Visual Studio Development Server is a web server that runs locally on Windows operating systems. As with IIS Express, it is specifically built to run ASP.NET on the local computer. It will not serve requests to another computer. Additionally, it will not serve files that are outside the application scope.

How do I debug IIS from Visual Studio?

In the Visual Studio toolbar, make sure the configuration is set to Debug, and either IIS Express, or the new IIS profile name, appears in the emulator field. To start debugging, select IIS Express or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.

Which server is used in Visual Studio?

IIS Express is the default web server for web application projects in Visual Studio 2012 and Visual Studio 2013, and it is recommended for both web application projects and web site projects.

What server does ASP Net use?

ASP.NET Core ships with Kestrel server, which is the default, cross-platform HTTP server. ASP.NET Core ships with Kestrel server, which is the default, cross-platform HTTP server.


1 Answers

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.

like image 63
Andrew Koransky Avatar answered Oct 19 '22 17:10

Andrew Koransky