Reputation: 3052
I don't understand why aspnet core environments are different from default visual studio configurations.
The first has defaults like Development
, Staging
, Production
and influence Startup
and appsettings.json
.
The latter has Debug
and Release
and determine the default build folder and the xml documentation.
Is it wrong to consider them separated in aspnet core solutions? Should i change the project configurations to match the aspnet core one?
Upvotes: 4
Views: 401
Reputation: 4187
Visual Studio Configurations are used to tell MSBuild how to build a project - mostly just compile with debug on or off but it can be other things.
Asp.NET Core environments are used to change the behavior of how an application run after it is built and deployed (or debugged). You can use it to change the behavior in code by checking the environment value. Also, appsettings are added based on environment. Appsettings.json is always loaded. If the environment is develop, appsettings.develop.json is loaded afterwards and the last settings loaded overwrite (or add too) the settings in appsettings.json. So usually you just use this environment variable to provide app settings per environment.
Upvotes: 1