开发者

Is it possible to have multiple services or applications share one single config file

开发者 https://www.devze.com 2023-02-12 22:44 出处:网络
If I have multiple applications or services which all share one configuration value (e.g. they开发者_开发技巧 all access the same database), is there a way to have them share one single config file in

If I have multiple applications or services which all share one configuration value (e.g. they开发者_开发技巧 all access the same database), is there a way to have them share one single config file instead of having to duplicate the values throughout each of their configs?


You can use the configSource attribute to point to a specific file.

Use the same file location from multiple .config files.

You can do this with multiple config sections, so one file for connection strings, one for app settings etc...


You could use the machine.config file to define settings shared between all applications on this computer. For ASP.NET applications you could have a web.config file at the root of the file which overrides those machine.config values and have yet another level inside the virtual directory.


You can load config file programmatically

And another link

0

精彩评论

暂无评论...
验证码 换一张
取 消