Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>file</code> attribute</p> <ul> <li>Specifies a relative path to an external file that contains custom application configuration settings</li> <li>specific to the <code>appSettings</code> section</li> <li>will <strong>merge</strong> (and override) settings in the .config file</li> <li>will not cause web application to restart when modifying the specified file</li> <li><a href="http://msdn.microsoft.com/en-US/library/ms228154(v=vs.100).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-US/library/ms228154(v=vs.100).aspx</a></li> <li>Using the <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx" rel="nofollow noreferrer">Configuration</a>.<a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.appsettings.aspx" rel="nofollow noreferrer">AppSettings</a>.<a href="http://msdn.microsoft.com/en-us/library/system.configuration.appsettingssection.settings.aspx" rel="nofollow noreferrer">Settings</a>.<a href="http://msdn.microsoft.com/en-us/library/ms134548.aspx" rel="nofollow noreferrer">Add</a> API will result in all settings being merged back into the main <code>.config</code> on a <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx" rel="nofollow noreferrer">Configuration</a>.<a href="http://msdn.microsoft.com/en-us/library/ms134087.aspx" rel="nofollow noreferrer">Save</a> call.</li> <li>since .NET 1.1</li> <li>Exception is not thrown if file does not exist.</li> </ul> <p><code>configSource</code> attribute</p> <ul> <li>can apply to most sections of a configuration file, not just <code>appSettings</code></li> <li>will override the <strong>entire section</strong> with the external file, <strong>no merging</strong></li> <li><a href="http://msdn.microsoft.com/en-US/library/system.configuration.sectioninformation.restartonexternalchanges%28v=vs.100%29.aspx" rel="nofollow noreferrer">CAN cause web application to restart</a></li> <li><a href="http://msdn.microsoft.com/en-US/library/system.configuration.sectioninformation.configsource(v=vs.100).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-US/library/system.configuration.sectioninformation.configsource(v=vs.100).aspx</a></li> <li>Using the <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx" rel="nofollow noreferrer">Configuration</a>.<a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.appsettings.aspx" rel="nofollow noreferrer">AppSettings</a>.<a href="http://msdn.microsoft.com/en-us/library/system.configuration.appsettingssection.settings.aspx" rel="nofollow noreferrer">Settings</a>.<a href="http://msdn.microsoft.com/en-us/library/ms134548.aspx" rel="nofollow noreferrer">Add</a> API will result in all settings being added to the file specified in <code>configSource</code> on a <a href="http://msdn.microsoft.com/en-us/library/system.configuration.configuration.aspx" rel="nofollow noreferrer">Configuration</a>.<a href="http://msdn.microsoft.com/en-us/library/ms134087.aspx" rel="nofollow noreferrer">Save</a> call.</li> <li>since .NET 2.0</li> <li><code>System.Configuration.ConfigurationErrorsException</code> is thrown if config source file does not exist.</li> </ul> <p>The <code>file</code> attribute specifies an external file containing custom settings like you do in the appSettings entry of the web.config file. Meanwhile, the external file specified in the <code>configSource</code> attribute contains the settings for the section which you declare the configSource for. For example, if you use the configSource attribute of the pages section, then the external file will contain the settings for the pages section.</p> <blockquote> <p>The custom settings declared in the external config specifified in the file attribute will be merged with the settings in the appSettings section in the web.config file. In the meanwhile, the configSource does not support merging, it means that you'll have to move the entire section settings into the external file.</p> </blockquote> <p><a href="http://www.codeproject.com/Messages/1463547/Re-difference-between-configSource-and-file-attrib.aspx" rel="nofollow noreferrer">http://www.codeproject.com/Messages/1463547/Re-difference-between-configSource-and-file-attrib.aspx</a></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