How to determine whether asp.net (mvc2) application is running under IIS (7) or VS internal web-server?
Clarification why I need this: I’m composing different dependency graph for IoC-container (ninject) that depends on the workaround (develop – when local VS, and production – when IIS)
Or may be another great solution so I can simply differ 3 workarounds: local (VS), test server (IIS) or production server (IIS). How in this case to differ the server? By PC name?
You could look at
System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleNameto see what process your ASP.NET app is running in.