Questions tagged [configsource]
30 questions
210
votes
1 answer
ASP.NET web.config: configSource vs. file attributes
Within an web.config-file in an ASP.NET-application some sections of config, like appSettings and connectionStrings, supports the attributes file and configSource.
What is the difference between using the file-attribute and the…

Seb Nilsson
- 26,200
- 30
- 103
- 130
25
votes
2 answers
External Config Files with elmah
I am using elmah (v1.1.11517.0) and am trying to move the config to an external source.
My config currently looks like this:

ilivewithian
- 19,476
- 19
- 103
- 165
8
votes
0 answers
The configSource file 'mycustom.config' is also used in a parent, this is not allowed
If you were developed ASP.NET web site in VS2010. (or before VS2015)
And your site is using Virtual Path, for example "http://localhost:12345/myvirpath"
And you have the customize config file by using configSource in Web.config like…

Chinor
- 91
- 1
- 6
8
votes
1 answer
Multiple external files for url rewrite under web.config
Earlier I wanted to keep the redirects out of web.config, because I have many rewrite rules. I was successfull in doing that by using
Now the problem is this file is…

Luckyy
- 1,021
- 4
- 15
- 29
6
votes
1 answer
share connectionstrings with multiple projects in same solution
I have multiple projects in the same solution. I would like them to share the same connectionStrings so that I don't have to change the this in multiple places.
In my web configs I have

D Rod
- 191
- 5
5
votes
1 answer
defining separate configSource for bindingRedirects and reference it in app.config
i'm trying to define a separate configuration file (lets say redirect.config). This separate config file contains assemblyBindings as follow:

Fabian Trottmann
- 214
- 4
- 12
5
votes
1 answer
Visual Studio 2012 Add controller with Context fails when connectionstring configSource in place
Working with VS 2012 + MVC4 + EF5 trying to add controller with Context fails when connectionstring configSource in place with Error :
"Unable to retrieve metadata for MvcTestApp.Models.DummyClass. Unable to open configSource file…

ronnymgm
- 51
- 3
5
votes
1 answer
Using configSource, and changing restartOnExternalChanges for core section
I'd like to use the configSource attribute of my web config section to define external files for various settings.
Particularly, the appSettings section. This means my config file has the following entry:

MattH
- 4,166
- 2
- 29
- 33
4
votes
0 answers
Chaining configSource within configuration files
Is it possible to 'nest' configSourced configuration? I receive an error: 'Unrecognized attribute 'configSource'. Note that attribute names are case-sensitive.'
Folder structure:
Root Folder
Config
EnvironmentConfiguration
…

Spotlight
- 41
- 2
3
votes
1 answer
Is there any alternative to configSource in applicationHost.config?
An ASP.NET site is load balanced using ARR (Application Request Routing) in IIS. The corresponding URL rewriting rule is placed in applicationHost.config.
Is there any way to separate this rule in a new config file? The tag configSource is no longer…

Ned
- 1,055
- 9
- 34
- 58
3
votes
0 answers
IIS7 Manager doesn't maintain configSource reference
I use ConfigSource=localfile to keep my connectionstrings in a separate file on the productiton server. This works great.
But if you use IIS7 Manager to edit connectionstrings on the server, the strings end up back in the web.config. Subsequent…

user367572
- 41
- 1
2
votes
1 answer
How do I change configsource value in remote configuration file
I'm using ConfigurationManager.OpenMappedExeConfiguration to read and modify web.config files of remote web services. This works well for the most part.
The config file splits out the unity configuration section using

Rob
- 4,327
- 6
- 29
- 55
2
votes
1 answer
Merge external .config files back into web.config that have used the configSource extraction
I use external config files for various dynamic sections in my web.config files. Essentially all the dynamic variables between environments (Prod, UAT, Test, Dev etc.) have been externalised out to generic named .config files.
My web.config is…

Simpsoid
- 23
- 3
2
votes
1 answer
Problem accessing AppSettings via configSource in Windows Server 2003
According to the MSDN documentation, configSource is supported on Windows Server 2003 SP2. However, when I try to access a setting using the following syntax:
System.Configuration.ConfigurationManager.AppSettings["SettingName"];
then null is…

Mark Carpenter
- 17,445
- 22
- 96
- 149
2
votes
1 answer
Dynamically read the value of configSource from connectionStrings in ASP.NET
I manually change my configSource to point to a local SQL Server or an SQL Azure server, as needed, during development. I would like for my code to find out the value of the configSource so that my code knows what database server is being…

Reid
- 3,170
- 2
- 23
- 37