Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create a solution level configuration file in Visual Studio?

I have a solution with multiple projects that will use the same connection strings. I can add a configuration file to each project with these strings, but was wondering if there was a way to add a single configuration file for the entire solution that could be accessed by all the individual projects within it?

like image 227
Patrick Avatar asked Feb 28 '14 16:02

Patrick


People also ask

How do I add solution configuration in Visual Studio?

In the Active solution configuration drop-down list, choose New. The New Solution Configuration dialog box opens. In the Name text box, enter a name for the new configuration. To use the settings from an existing solution configuration, in the Copy settings from drop-down list, choose a configuration.


2 Answers

Instead of adding the config file to each project, use Add as Link so that there is only one copy of the file that all the projects are accessing.

Essentially you're adding the address rather than the file itself which means that any changes to the file at the address will affect all projects reading from the address.

like image 89
keyboardP Avatar answered Oct 23 '22 17:10

keyboardP


Create config once in your first project.

Then all other projects, add the existing item, but hit the arrow on the Add button and Add As Link instead.

The one file will be shared amongst your projects.

like image 2
Starscream1984 Avatar answered Oct 23 '22 17:10

Starscream1984