I am writing a test platform for some semi-automated testing using a Console application, but I need to get the connection string from the project I am testing. I don't want to reference the other application directly or otherwise have an accessor in the project I'm testing.
What I've managed to do so far is create a link to the other project's Web.config file in my TestUtility project, and I've set it to Copy if newer
. It's the only Web.config in my test project's root folder, but WebConfigurationManager.OpenWebConfiguration(null)
seems to be opening some OTHER Web.config, as the only connection string in it refers to .\SQLEXPRESS (not in any file in my solution, my path would be .\sql2008 in this configuration - which varies).
Any hints or tips as to how to access that config section from another project?
(Yay first question)