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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Apr 22, 2022, 7:30 PM
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.
Rajeev KumarPosted Mar 6, 2023, 1:25 PM
Anupam MaitiPosted Apr 25, 2022, 5:54 AM
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
Sachin SinghPosted Apr 22, 2022, 8:31 PM
Uttam KumarPosted Apr 20, 2022, 7:27 AM