A web.config file configures an ASP.NET application hosted by IIS. Include it in the published application so IIS can run it correctly and avoid exposing unintended files. section 27.2.2
During publishing, the deployment tools handle the file as follows:
- Copy an existing web.config from the project into the publish directory. section 27.2.2
- Create the correct web.config automatically when the project does not contain one. section 27.2.2
- Keep the project free of a custom file when no IIS customization is needed. section 27.2.2
- Customize the IIS ASP.NET Core Module through web.config when required. section 27.2.2
dotnet publish --output publish_folder --configuration Release
Publish the application to a folder before copying it to the IIS application path. section 27.2.2
