I inherited an old vs.net 2010 WCF webservice project to make a fix to. It has the following connectionString settings in its web.config, to differentiate between dev, qa, & production & I'm having trouble connecting to them when trying to debug & hoping someone can help:
<connectionStrings>
<add name="OrderDataContextContainer.Development" connectionString="metadata=res://<conn string here>" providerName="System.Data.EntityClient" />
<add name="OrderDataContextContainer.QA" connectionString="metadata=res://<conn string here>" providerName="System.Data.EntityClient" />
<add name="OrderDataContextContainer.Production" connectionString="metadata=res://<conn string here>" providerName="System.Data.EntityClient" />
</connectionStrings>
The code I added, makes a db connection via the following "using" statement:
using (OrderDataContextContainer db = new OrderDataContextContainer())
{
//my code fix here
}
If I add the following web.config connection to the list of connectionStrings, it connects fine (i.e. no "Development", "QA", or "Production" appended):
<add name="OrderDataContextContainer" connectionString="metadata=res://<conn string here>" providerName="System.Data.EntityClient" />
However, I can't do it like this because my company requires separate dev, qa, & prod strings for when I send this fix to the QA team for testing. If I don't include the above connection, I receive the following error on that "using" statement:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
Before running the project, I created "Development", "QA", & "Production" configs in my vs.net Configuration Manager & set it to "Development" but no luck.
Any idea how I can get my application to connect via the earlier mentioned connection strings?