Is web.config file is must to execute any asp.net application if we are maintaining connection strings on the page itself.

>Is web.config file is must to execute any asp.net application

It is a web application configuration file.

but my question is, what happen if I delete or Exclude Web.Config file from the application. does application runs normally or throw some error?

>what happen if I delete or Exclude Web.Config file from the application.

Well, if you do not want to override machine config then it is ok. What will be happned? - Nothing except you can not have an option to set application specific settings.

Text from the above posted msdn link :

Multiple configuration files, all named Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. Configuration files in child directories can supply configuration information in addition to that inherited from parent directories, and the child directory configuration settings can override or modify settings defined in parent directories. The root configuration file named systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config provides ASP.NET configuration settings for the entire Web server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.