Plugin to use its own app.config

前端 未结 6 1216
星月不相逢
星月不相逢 2021-02-19 21:22

I finally managed to build a working solution of a plugin architecture with help of some guys over here, but now a new problem arises.

My hosting application uses it\'s

6条回答
  •  故里飘歌
    2021-02-19 21:59

    You're working against the architecture of app.config. You get one app.config file per executable (EXE, not DLL). The executable launches, creates its AppDomain, and then loads MyApp.exe.config. You can add app.config objects all you want in Visual Studio, but they are ignored for DLLs. I think what you want to do is manually copy the XML from the dll.config and paste it into the application level app.config. (I'm sure there's a way to automate this using TeamBuild or some such.) The overridden values will then be available to your Properties.Settings class.

提交回复
热议问题