Using app.config with a class library

后端 未结 9 1350
忘掉有多难
忘掉有多难 2020-11-27 06:47

Frequently I need to create a .Net class library that requires an app.config for things such as database connection strings. However, these settings must be in the calling a

9条回答
  •  旧时难觅i
    2020-11-27 06:51

    It is no (big) problem to use its own config file for every class library. If you use vb.net you can add values via the "my project" panel on the "Settings" page.

    The only thing you have to do is to call "My.Settings.Save" on your class library settings (and not only on your main application settings file).

    That works with c#, too (But probably needs more manual work).

提交回复
热议问题