Can you programatically detect if the Development server in Visual Studio is used instead of IIS?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With