Web.config file is present in asp.net core application or not?? Is it mandatory into the application for deployment??
Loading
Web.config file is present in asp.net core application or not?? Is it mandatory into the application for deployment??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sam HobbsRank #107 · 20.5K reputationPosted Apr 22, 2022, 3:30 PM EDT
See:
web.config file | Microsoft Docs
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/web-config?view=aspnetcore-6.0
It says:
If the web.config file is missing, incorrectly named, or unable to configure the site for normal startup, IIS may serve sensitive files publicly.
And it says:
The web.config file must be present in the deployment at all times, correctly named, and able to configure the site for normal start up. Never remove the web.config file from a production deployment.
As far as I know, only IIS uses a web.config file so if IIS is not being used for the site then a web.config file is not needed.
Uttam KumarRank #1,076 · 1.8K reputationPosted Apr 20, 2022, 3:27 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Apr 22, 2022, 4:31 PM EDT
Anupam MaitiRank #295 · 8.5K reputationPosted Apr 25, 2022, 1:54 AM EDT
We already know that
web.configis not used as the configuration file for ASP .NET Core web applications. Those applications now useappsettings.json, a JSON configuration file.IIS uses the ASP.NET Core Module to handle the ASP .NET Core application’s requests. The module is an HTTP handler. The handler has some settings which are read by IIS. The handler has settings like
processPath,arguments,hostingModel. These settings decide which .NET core application should be invoked and what is the hosting model for the application.If a web.config file is not present at root, then it is created with the correct
processPathandargumentsduring the publish operation.If a web.config is already present at app’s root, then it is transformed to use correct values for
processPathandargumentssettings and it is copied to published output directory.Reference - The Code Blogger - ASP .NET Core Module and Web.Config File For IIS Hosting
Rajeev KumarRank #1,334 · 1.3K reputationPosted Mar 6, 2023, 8:25 AM EST