本文介绍了集中同一解决方案中多个项目的连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前在解决方案中有三个项目,它们都有各自的App.config文件,并且具有相同的确切连接字符串.
I currently have three projects in my solution that all have their own App.config file with the same exact connection string.
有没有一种方法可以合并连接字符串/app.config文件,这样我只需要对一个位置进行更改?
Is there a way to consolidate the connections strings / app.config files so that I only need to make changes to one location?
推荐答案
有几种方法可以实现:
- Put common configuration settings in machine.config as shown here
- Put common configuration settings in a central file and link to that in each projects's app.config as shown here
- Store the configuration settings in the registry
对我来说,我总是使用最后的解决方案:)祝你好运!
For me, i always work with the last solution :)Good luck!
这篇关于集中同一解决方案中多个项目的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!