6

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

1 Answer 1

13

I fixed this by changing

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

to

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

:/

Sign up to request clarification or add additional context in comments.

1 Comment

Just a suggestion: I hope you choose a better place for your connectionStrings.config file as the bin folder normally contains build output and is not a very intuitive place for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.