Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Setting.settings and web.config?

This might sound a bit dumb.

I always had this impression that web.config should store all settings which could be subject to change post-build and setting.settings should have the one which may change pre-build.

but I have seen projects which had like connection string in setting.settings. Connection Strings should always been in web.config, shouldn't it?

I am interested in a design perspective answer.

Just a bit of background: My current scenario is that I am developing a web application with all the three tiers abstracted in three separate visual studio projects thus every tier has its own .settings and .config file.

like image 446
neebz Avatar asked May 23 '10 00:05

neebz


People also ask

What is difference between web config and app config?

The web. config file is required for ASP.NET webpages. The app. config file is optional in an application and doesn't have to be used when writing desktop applications.

What is a web config?

A web. config file is a Windows file that lets you customize the way your site or a specific directory on your site behaves. For example, if you place a web. config file in your root directory, it will affect your entire site (www.coolexample.com).

What is the role of web config?

web. config file is an XML-based configuration file used in ASP. NET-based applications to manage various settings that are concerned with the configuration of our website. In this way, we can separate our application logic from configuration logic.

What is app setting in web config?

In this article we will examine some tips and best practices for using the configuration system for the best results. The <appSettings> element of a web. config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work.


1 Answers

Web.config is mostly meant for configuration, and it also stores the default values of your settings.

Settings.settings is just a convenience file for Visual Studio to provide a UI for editing your settings.

The .config comes in two different flavors: App.config for Windows applications, which will be named YourApplication.exe.config, and the Web.config for web applications. They share the same schema, syntax, and options.

  • You may notice that if you add a setting to Settings.settings, it gets added to the .config as well.
  • The .config must be deployed with apps, but Settings.settings doesn't need to.
like image 198
Venemo Avatar answered Oct 10 '22 16:10

Venemo