TekiSreelakshmi
asked on
Configurationmanager.Connectionstrings is retrieving values from machine.config instead of app.config
Hi,
I have a class project among others inside a blank VS project. I have added an app.config file to this project and am using Configuration.Configuratio nmanager.C onnections trings to retrieve connection strings from it. However it is retrieving values from machine.config instead of app.config. Any idea why this is happening and how do I change it?
Thanks in advance
I have a class project among others inside a blank VS project. I have added an app.config file to this project and am using Configuration.Configuratio
Thanks in advance
When retrieving connection strings by provider name from the app.config file in a Windows application, the connection strings in machine.config get loaded first, and then the entries from app.config. Adding clear immediately after the connectionStrings element removes all inherited references from the data structure in memory, so that only the connection strings defined in the local app.config file are considered.
reference:
http://msdn.microsoft.com/en-us/library/ms254494%28VS.80%29.aspx
reference:
http://msdn.microsoft.com/en-us/library/ms254494%28VS.80%29.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://stackoverflow.com/questions/624942/assemblys-app-config-is-being-ignored-machine-config-being-read-instead
http://stackoverflow.com/questions/242468/where-does-configurationmanager-connectionstrings-get-its-value