home / software / tips and tricks / What is the difference between ‘file’ and ‘configSource’ using in configuration file for accessing external configuration files?

What is the difference between ‘file’ and ‘configSource’ using in configuration file for accessing external configuration files?

Updated:  10/04/2012 07:10 AM
Author:  Shiju Mathews

Status:    Resolved.


1. If you are using ‘configSource’ attribute for accessing external configuration file, on the base configuration file (web.config) sub elements should be empty. For example in web.config


But if we are adding the external file by using “file” attribute Keys can be added to web.config in <appSettings> element.

2. When using ‘configSource’ element the path is relative but in file attribute the path should be absolute (“D:\Personnal\Projects\ External.config”). If the config files are in the same directory, path is not required.
Tags: What is the difference between ‘file’ and ‘configSource’ using in configuration file for accessing external configuration files?
Updated on: October 2024