Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can we run asp.net application without web.config file?


Asked by Vicente Gardner on Dec 14, 2021 ASP.NET



Yes, we can run an Asp.Net web application without web.config file but without in debugging mode. If we don't configure any settings in web.config file then it consider machine.config file as default configuration.Machine.config file contains default settings for all the asp.net web applications which will be applied to all asp.net applications.
Similarly,
If we don't configure any settings in web.config file then it consider machine.config file as default configuration.Machine.config file contains default settings for all the asp.net web applications which will be applied to all asp.net applications. Yes, we can run Asp.net web application without wen.config file.
Accordingly, This config file will automatically installed when your application getting executed. i.e MACHINE.CONFIG file contains defaults settings for all the asp.net web applications. Because all the configuration settings will be available under MACHINE.CONFIG file by default these settings will be applied to all asp.net applications.
Furthermore,
However, it is not a good idea. Until ASP.Net restarts the AppDomain, it will not look at web.config. If you change web.config, your changes will have no effect until the AppDomain is restarted. You can create an external settings file and then reference it in your web.config.
Thereof,
You can change the ASP.NET configuration settings for a single application if you create a Web.config file in the root folder of the application. When you do this, the settings in the Web.config file override the settings in the Machine.config file. You can create a Web.config file by using a text editor such as Notepad.