0

Which one is the default configuration file in dotnet?

Web.config or machine.config or system.config.

Can anyone please tell?

3

3 Answers 3

2

.config files inherit (or override) each other in a hierarchy, usually with machine.config at the top defining the configuration machine wide. Then web.config at various levels through the file structure of your application.

See this msdn page for a discussion of the hierarchy:

http://msdn.microsoft.com/en-us/library/ms178685.aspx#scope_of_configuration_settings

If you were looking for the concept of a default there are two takes on this:

The config that sets the defaults for the machine that you're running on is machine.config.

The config that you would normally edit to make changes (ie by default) when working on something is the web.config in the root of your project/application - you don't generally make changes to machine.config unless absolutely necessary as it affects the operating environment for all other .net applications on the machine.

Sign up to request clarification or add additional context in comments.

Comments

0

The *.config files have a scope. The web.config is specific for the current application, whilst the machine.config is for the machine etc.

So the answer to your question depends on the scope, for a specific web application, the 'default configuration' is the Web.Config.

The web.config file also 'inherits' some properties from the other 'parent' config files.

Read more here

1 Comment

I need to know about main configuration file for asp.net not application specific. So you would say Machine.config?
0

Each files are for different purpose, value is taken from both files, there is nothing called default file, Web.config is not mandatory file but Machine.cofig is Mandatory.b'coz it is a configuration file which is used to maintain the config details for all ASP.NET websites registered with in the web server

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.