Centralize connection strings for multiple projects within the same solution

后端 未结 3 1695
南笙
南笙 2020-12-08 22:13

I currently have three projects in my solution that all have their own App.config file with the same exact connection string.

Is there a way to consolidate the conne

3条回答
  •  旧巷少年郎
    2020-12-08 22:54

    There's a few ways you could do it:

    1. Put common configuration settings in machine.config as shown here
    2. Put common configuration settings in a central file and link to that in each projects's app.config as shown here
    3. Store the configuration settings in the registry

    For me, i always work with the last solution :) Good luck!

提交回复
热议问题