How to access app configuration from a .dll?

前端 未结 5 1994
执念已碎
执念已碎 2021-02-09 10:42

I recently broke out a part of my winform app in a .dll. Some of the classes in that dll wants fetch/store user settings. The classes just used the VS generated Settings file s

5条回答
  •  孤城傲影
    2021-02-09 10:53

    The Properties class is autogenerated. It is really a wrapper on the config file. If you don't want to change your design, just go into the code and copy it to your DLL. But remember it will no longer be magically maintained (regenerated). Or you can use ConfigurationManager to get at config file directly.

提交回复
热议问题