Last post Oct 26, 2019 02:46 PM by bruce (sqlwork.com)
Oct 26, 2019 01:26 PM|BitShift|LINK
If building a .net core console app that hosts asp.net core (a worker service), and using a publish profile, will setting the EnvironmentName property have any effect or is this only relevant to publishing web apps to IIS?
in publish profile
When I publish the console app to a folder location, then run it, the settings being used are coming from appsettings.json and not appsettings.Local.json
Oct 26, 2019 02:46 PM|bruce (sqlwork.com)|LINK
EnvironmentName just sets an environment variable property in the web.config for the asp core hosting module. If you run the asp core app from the command line, then it will not see this. You must manually set the environment variable ASPNETCORE_ENVIRONMENT
before running the app.