From the course: Deploying ASP.NET Core Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Understand Web.config
From the course: Deploying ASP.NET Core Applications
Understand Web.config
- You may have noticed that there's a Web.Config file in the directory, along with your published binaries. It plays an important role, but maybe not the one you expect. If you've used ASP.NET Core in the past, you're probably familiar with using Web.Config to store configuration for your application. ASP.NET Core doesn't use WebConfig because it uses a new configuration model based on appsettings.json instead. So why is WebConfig in this folder? It turns out that IIS still needs WebConfig, even if ASP.NET Core isn't using it. Web.Config is used to configure the ASP.NET Core module that IIS uses to act as a reverse proxy to Kestrel. When you run dotnet publish, WebConfig is generated for you automatically. You shouldn't need to touch it or modify it yourself. It is important that WEB.Config exists in the root of your published application. It's required for IIS to properly host your ASP.NET Core application, and it also prevents IIS from accidentally serving the content from the…