Using web.config as store for referenced class library's Properties.Settings class?

微笑、不失礼 提交于 2019-12-06 09:30:46

I'm not 100% sure what you're asking, but I see two possible questions:

  1. The class library has properties that are controlled (set) by the config file, but class libraries don't consume config files. If that's the case, then all you need to do is move those settings to the calling app's config file - the class library will automatically use the calling app's Web.config (or App.config, as appropriate).

  2. You want to create a custom Configuration Section, which can also be done: How to: Create Custom Configuration Sections Using ConfigurationSection

Unless I've totally misread your question (always a possibility with me :) ), I'd go with #1 as it's easier, unless there's something unique or required in your design to move you to option 2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!