I would like to publish my app using all those 3 different predefined environment variables(Development, Staging, and Production), but I cannot figure out how to target different environment when creating the publish profile.
Since .NET Core doesn't support multi-version of web.config, I cannot use environmentVariable tag in config file to automate my publish.
I also tried launchSettings.json, everything seems fine in VS and I can run different environment locally. I just want to automate my publish process too, so when I use different publish profile and then different environment is targeted.
Publish profile is used by dotnet publish
command, that only packs app+dependencies and makes them ready for deployment:
dotnet publish compiles the application, reads through its dependencies specified in the project.json file and publishes the resulting set of files to a directory.
You specify Environment on target platform, where you do deployment, by using ASPNETCORE_ENVIRONMENT
environment variable.