In my ASP.NET application I have a web.config file. In the web.config file I have a connection string…
<connectionStrings> <add name='HRDb' connectionString='xxxxx' providerName='System.Data.SqlClient' /> </connectionStrings>
Yet, when I retrieve this value using ConfigurationManager.ConnectionStringsp['HRDb'], I get the my old connection string, not the new one.
Where else (apart from web.config) does the ConfigurationManager read connection string values from?
I’m running the application from VS.NET (not deployed to IIS).
I figured out what was going wrong.
So to answer my own question… ConfigurationManager only reads from web.config.
My problem was that the project was configured to use an IIS web server when running the project instead of using the Visual Studio Development server. So I was in fact running an old version of my application. Silly.