开发者

.Net configuration file

开发者 https://www.devze.com 2022-12-21 19:36 出处:网络
I have console app \"A\" that references another console app \"B\". \"B\" app has its own configuration file. When I launch project \"A\", the application fails, because app \"B\" cannot configure its

I have console app "A" that references another console app "B". "B" app has its own configuration file. When I launch project "A", the application fails, because app "B" cannot configure its components, since it uses the configuration of app "A". How to get around this problem? I want that project "B" to source its own configurat开发者_如何学Cion file.


You'll have to put the relevant sections from B's configuration file into A's configuration file.


The executing assembly must have all configuration information in its configuration file. You will have to import all settings from "B" into the configuration file of application "A".


You can copy the relevant XML sections from B.exe.config to A.exe.config.

A.exe will always read from A.exe.config, but if the relevant configuration sections from B.exe.config are available in A.exe.config, it should still work.

You can merge configuration settings as needed.

0

精彩评论

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