我可以在执行期间加载 xml 中的 WCF 配置吗?

发布于 2024-10-11 16:00:45 字数 248 浏览 7 评论 0原文

我想使用端点配置名称创建客户端代理。在创建代理之前,我想获取 XML 中的配置并将其加载到内存中。它不是在 app.config 中指定此配置的选项。此外,它不是以编程方式创建配置的选项(例如实际实例化端点、绑定等对象)。考虑到这些限制,我假设我必须以某种方式与 .net 的配置管理器进行交互?理想情况下,我可以告诉配置管理器从父元素为的 xml 块加载数据。

这有可能吗?

I want to create a client proxy using an endpoint configuration name. Prior to proxy creation, I want to take the configuration in XML and load it into memory. Its not an option to specify this configuration in app.config. Also, its not an option to create the configuration programmatically (like actually instantiating the endpoint, binding, etc. objects). Given these constraints, I'm assuming that I have to somehow interact with .net's configuration manager? Ideally, I could tell the configuration manager to load data from a chunk of xml with the parent elment being <system.serviceModel>.

Is this at all possible?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文