Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Need the equivalent of HttpContext.IsDebuggingEnabled #97

Closed
davidfowl opened this issue Jul 7, 2014 · 6 comments
Closed

Need the equivalent of HttpContext.IsDebuggingEnabled #97

davidfowl opened this issue Jul 7, 2014 · 6 comments

Comments

@davidfowl
Copy link
Member

http://msdn.microsoft.com/en-us/library/system.web.httpcontext.isdebuggingenabled(v=vs.110).aspx

We used to have this in katana with the "host.AppMode" key in the environment dictionary. The default implementation in PipelineCore might map to the environment name "development" in https://github.com/aspnet/Hosting/blob/63f643e0c1d9be3485300a297a74b13c8ed8299e/src/Microsoft.AspNet.Hosting/HostingContext.cs#L34.

/cc @lodejard and @Tratcher for comments

@lodejard
Copy link
Contributor

lodejard commented Jul 7, 2014

How about adding string HttpContext.ApplicationEnvironment {get;} and three bool HttpContext.IsProduction {get;}, IsStaging, and IsDevelopment booleans as a convenience for the well-known environment names

@davidfowl
Copy link
Member Author

Like

@Tratcher
Copy link
Member

Tratcher commented Jul 7, 2014

Days like this I wish we had extension properties... Can we get those?

@muratg
Copy link

muratg commented Jan 21, 2015

Will aspnet/Hosting#100 solve this?

@davidfowl
Copy link
Member Author

Closing this out

@imranbaloch
Copy link

@davidfowl The env.IsEnvironment("Development") returns true whether we select Debug or Release mode from VS. Is it not good to change the environment variable value if we select different configuration? The problem is that devs are used to select Release config in order to test how the application will work in production mode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants