I have created a repository for publishing IIS with the environment configuration in Web.config.
https://github.com/expressiveco/AspnetCoreWebConfigForEnvironment
- Setup
- Get the sections from .csproj and .user.csproj files into your project files.
- Get the MyAspNetEnvironment.props, web.development.config and web.production.config files.
- Configuration
- Change the value of ASPNETCORE_ENVIRONMENT property in user.csproj relevantly.