How to detect if ASP.NET site is running locally, in azure web role, or azure web site?
问题 Note: This is different from the question of detecting running locally versus in an Azure role, which I understand has been answered already. I've got an APS.NET MVC app which I deploy to Azure. I'm running V2.5 of the Azure tooling. I'd like to be able to detect which of the following three scenarios the code is running in: Locally (debugging on IIS), Azure website or Azure web role I've seen in other posts the suggestion to use the following: RoleEnvironment.IsAvailable However, this seems