In ASP.NET 5 in the Configure
method of the Startup
class we can get a reference to an object whose class implements IHostingEnvironment
in the parameters. One of the properties of this class is EnvironmentName
. I have already seen in example codes an accomplishment of a check in this property to detail errors or not. If this property is Development
then it is the development environment and shows the errors in detail. Otherwise it is the production environment and it shows a friendly page warning that an error has occurred.
So far so good, what I do not understand is how this property is defined. Why does it always have development value? How is this property really defined?