2

Currently I have a larger Solution with different projects (A web application and a windows service,...). Since both applications use the same database, I created a connectionstrings.config file which is included by the web.confg (or app.config) using the connectsionstring's configsource attribute.

To maintain only one file, I did the following:

  • One project contains the "real" connectionstrings file
  • For all other projects that require the connectionstrings, I have added the existing connectionstrings.config file using the "add as link" option within Visual Studio.

To support different connectionstrings for different environments, I created environment folders that contain their own connectionstrings file. These files are used to replace the default ones during the buildprocess.

I wanted to know if you have other solutions for configuration values within different environments/projects?

1 Answer 1

3

If you are using Visual Studio 2010, you can use the config transform (video) feature.

See this blog post for details.

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

2 Comments

Thank you for your answer - but it seems that this only works for web projects. As I mentioned I have multiple different projecttypes. When searching for more details on your solution, I found the following questions/answers that seem to help link
@Bernhard - here is a workaround: publicityson.blogspot.com/2011/04/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.