When I create a new ASP.NET 4 web application, the web.config file is almost empty. What happened to all the configuration elements that were there prior to ASP.NET 4?



All the major configuration settings are moved into machine.config file, and all the applications will inherit the setting from this file. If an application needs to override the default settings, we can do so using the application specific configuration (web.config) file. ASP.NET 4 applications have clean web.config files.


If you create a new asp.net 4 empty web application, the only entry that you will find is shown below.



Note: If you create a new ASP.NET Web Application, instead of a new ASP.NET Empty Web Application, you will find a lot more confiuration entries in the web.config file. This is because, the template for ASP.NET web application overrides some of the default settings inherited from machine.config.

6 comments:

  1. Where can i find the machine.config in our application?

    ReplyDelete
    Replies
    1. C:\Windows\Microsoft.NET\Framework\\Config\


      Delete
    2. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

      Delete
  2. .net creates machine.config for you when you install framework, search for that file on your hard drive

    ReplyDelete
  3. C:\Windows\Microsoft.NET\Framework\\Config\

    ReplyDelete
  4. unimaginable approach in presenting the Video lessons. Exceptionally helpful to experienced too.

    ReplyDelete

If you are aware of any other asp.net questions asked in an interview, please post them below. If you find anything missing or wrong, please feel free to correct by submitting the form below.

 
Disclaimer - Terms of use - Contact Us