What is the difference between App.conf and Web.conf?

2
  • What are the differences between App.conf and Web.conf ?
asked by anonymous 23.01.2015 / 20:02

2 answers

4

In this topic , the response author commented:

  

Web.config and App.config

     

The choice of the configuration file name is determined by the hosting environment you choose for the service. If you are using IIS to host your service, use a Web.config file. If you are using any other hosting environment, use an app file.

     

In Visual Studio, the file named App.config is used to create the final configuration file. The final name actually used for the configuration depends on the assembly name. For example, an assembly with the name "Coho Winery.exe" has a name of "Coho Winery.exe.config" final configuration file. However, you just need to modify the app file. Changes made to the file are automatically made to the final application configuration file at compile time.

     

Under Using an App.config, Archiving the Configuration System merges the App.config file with the contents of the Machine.config file when the application is started and the configuration is applied. This mechanism allows the entire machine settings to be defined in the Machine.config file. The App.config file can be used to override the settings of the Machine.config file; you can also lock the settings in the Machine.config file so that they get accustomed. In the Web.config case, the configuration system merges the Web.config files into all directories that point to the application directory for the configuration that will be applied.

See the documentation on the Microsoft website here

    
23.01.2015 / 20:15
1

As English response in OS :

  

Web.Config is used for asp.net web projects / web services.

     

App.Config is used for Windows Forms, Windows Services, console applications, and WPF applications.

That is:

  • If your application is hosted with IIS, use web.config.

  • If your application is Windows, use app.config.

We use Web.Config in ASP.NET web projects or web services, and App.Config we use in Windows Forms applications, Windows Services, Console applications and and WPF.

    
23.01.2015 / 20:14