Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

<connectionStrings  configSource="bin/connectionStrings.config" />

and then I have added a file as a link to my "connectionsStrings.config" which sits at the solution level.

I have changed the properties so that the "Copy to Output Directory" is "Copy always" and the "Build Action" is "Content"

But I get the following error:

 The configSource attribute must be a relative physical path, so the '/' character is not allowed.

I am not sure how to get around this issue, any help would be great.

Cheers

like image 849
D Rod Avatar asked Jul 18 '13 16:07

D Rod


1 Answers

I fixed this by changing

<connectionStrings  configSource="bin/connectionStrings.config" />

to

<connectionStrings  configSource="bin\connectionStrings.config" />

:/

like image 169
D Rod Avatar answered Oct 27 '22 00:10

D Rod