开发者

.NET DLL that adds config element when being referenced

is there any possibility to automatically add a config section to the app.config/web.config from a .NE开发者_JS百科T DLL when it is being referenced?

Details: I created an own DLL that holds database methods. This DLL needs a custom config section, that has now to be added manually for every project. But I want to have this custom section added to the app.config/web.config automatically when I reference the DLL.

Thanks in advance for your help.


No - adding a reference is just that - adding a reference. When for example you want to use log4net, you always need to reference it and then add the config section manually to set it up.

When you think about it, this makes sense - no 2 configurations are the same, so how could you "automatically" add it? If the configuration were the same for all these projects that need to use it, then why is it config-based in the first place?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜