Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>UPDATE: In ASP.NET Core Land, configuration is no longer managed via either of these - <a href="http://www.paraesthesia.com/archive/2018/06/20/microsoft-extensions-configuration-deep-dive/" rel="nofollow noreferrer">see this fantastic writeup from Travis Illig with the a-z on <code>Microsoft.Extension.Configuration</code> and <code>Microsoft.Extensions.Configuration.Binder</code> which are effectively a superset of all this</a></p> <hr> <p>Settings (Both from a .settings set and <code>Configuration.AppSettings</code>), are stored in the .config file [alongside lots of other stuff].</p> <p>The difference is that the .settings stuff [which was added in .NET 2.0 / VS2005] layers a strongly typed class on top of a set of settings that belong together whereas <code>Configuration.AppSettings</code> just lets you retrieve strings, forcing you to do any conversions, and doesnt have the notion of defaults. (the Configuration class has actually been shunted into a side assembly to reflect this - you need to add a reference to System.Configuration explicitly if you want it).</p> <p>Adding a .settings to your project will result in an app.config being added to house the settings if you dont already have one. The class which reads the settings is automatically generated each time you change the list of settings for your component/application.</p> <p>Other features of .Settings is the ability to designate some settings as user-specific (and also to save the user-specific settings with a single call).</p> <p>The best reason of all to use .Settings is generally that you gain the ability to clearly identify who is using which setting in a code base by following usages of properties (and each set is a separate block in the XML file). <code>Configuration.appSettings</code> is more global in it's nature - it's just a bag of properties and you dont know which DLL, subsystem or class depends on a particular setting entry. See <a href="http://ardalis.com/applying-interface-segregation-to-configuration-files" rel="nofollow noreferrer">this blog post from Steven Smith</a> for much more.</p> <p>Finally, if you still haven't read enough about settings management, you're not going to beat <a href="http://feedproxy.google.com/~r/RickStrahl/~3/I41oCo7CAW4/Building-a-better-NET-Application-Configuration-Class-revisited" rel="nofollow noreferrer">this Rick Strahl post on the subject</a> for completeness or sheer quantities of ideas and angles.</p> <p>ASIDE: There's also the <a href="https://github.com/aspnet/Configuration" rel="nofollow noreferrer">ASP.NET vNext Configuration</a> stuff, <a href="http://whereslou.com/2014/05/23/asp-net-vnext-moving-parts-iconfiguration/" rel="nofollow noreferrer">outlined in this article</a> which is quite flexible and offers a different angle on configuration settings management.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload