Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an ASP.NET web app run without web.config

Can my asp.net web application run without a web.config? For argument's sake lets say that I'm not connecting to a Database or explicitly reading any configuration information . I have tried it out and I'm able to run a web app successfully in VS 2008 without a web.config.

This brings me to the question as to how are authentication and session modes configured now ? The machine.config and the root web.config files ( in the framework folder) do not have any authentication/session modes configured explicitly .

Any ideas ?

Thanks.

like image 444
Sennin Avatar asked Nov 01 '10 18:11

Sennin


3 Answers

yes we can run asp.net application without web.config file,if u r not configure any settings in web.config file then it will take machine.config file for default configurtaons.This config file will automatically installed when your application getting executed.

Because all the configuration settings will be available under MACHINE.CONFIG file by default these settings will be applied to all asp.net applications.

like image 91
NANI Avatar answered Oct 18 '22 18:10

NANI


You'd have to read the documentation to see the defaults, which for authentication is probably windows, and session mode would be in process.

like image 42
Brian Mains Avatar answered Oct 18 '22 17:10

Brian Mains


Yes, you will be able to run an ASP.NET application without a WEB.CONFIG file in its root folder.

If the application doesn’t find a WEB.CONFIG file in its root folder, then it will take MACHINE.CONFIG file for default configurations. But you will not be able to debug the application as debugging is turned off by default in MACHINE.CONFIG file.

Find more information about machine.config files over here

like image 36
Sashi Kumar Nagulakonda Avatar answered Oct 18 '22 16:10

Sashi Kumar Nagulakonda