liveBook · Manning

Web.config file

As explained in ASP.NET Core in Action, 3e

A web.config file is an XML configuration file traditionally used to configure ASP.NET applications hosted by Internet Information Services.

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

How ASP.NET Core in Action, 3e covers it

How deep it goes
Explains inclusion, automatic generation, and customization, but does not detail XML settings.
Examples
Uses folder publishing and an IIS site reachable at http://localhost:81.
What you can do after
Operate/configure an ASP.NET Core deployment behind IIS using generated or customized web.config settings.
How it connects
Connects web.config with IIS, ASP.NET Core Module, reverse proxies, .NET CLI, and Visual Studio.

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.