如何为每个 DLL 实例创建 1 个 .NET 设置

发布于 2024-08-29 18:48:06 字数 191 浏览 6 评论 0原文

我的服务是一个DLL,可以多次安装。 DLL 的设置存储在Settings.settings 中。 DLL 的每个实例都有自己的 Settings.settings。这可以通过 Settings.settings 来完成,还是我必须创建自己的配置方案?如果可能的话,我想避免重新发明轮子。我不一定需要单独的文件,只需一种允许我为 DLL 的正确实例加载正确设置的机制。

My service is a DLL and it can be installed multiple times. The DLL has its settings stored in Settings.settings. Each instance of the DLL will have its own Settings.settings. Can this be done with Settings.settings, or do I have to create my own configuration scheme? I want to avoid reinventing the wheel if possible. I don't have to necessarily have separate files, just a mechanism for allowing me to load the correct settings for the correct instance of the DLL.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挖个坑埋了你 2024-09-05 18:48:06

也许您可以使用将安装在与您的服务相同的目录中的 app.config: http://www.codeproject.com/KB/dotnet/dllappconfig.aspx

perhaps you could use an app.config that will get installed in the same directory as your service: http://www.codeproject.com/KB/dotnet/dllappconfig.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文