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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With