如何告诉WCF客户端读取设置了不同的配置文件呢? [英] How to tell WCF client to read settings out of different config file?
问题描述
我要建一个组件,它是另一种软件产品的延伸。它加载一个dll到该产品,因此我没有在主exe文件的app.config文件控制。我的组件使用WCF,我希望能够用一个config文件,而不是编程中的code进行配置。有没有办法告诉WCF来从一个特定的配置文件中的所有绑定等设置?
I'm building a component that is an extension for another software product. It's loaded as a dll into that product, and therefore I don't have control over the main exe's app.config file. My component uses WCF and I'd like to be able to configure it using a .config file instead of programmatically within the code. Is there a way to tell WCF to get all the binding etc settings from a specific config file?
推荐答案
最后@ marc_s的回答是一个我去:没有。相反,我们存储与其他系统设置的配置选项,然后以编程方式应用它们来绑定等设置在运行时。
Ultimately @marc_s's answer was the one I went with: no. Instead we store configuration options with other system settings and then apply them programmatically to the binding etc settings at runtime.
这篇关于如何告诉WCF客户端读取设置了不同的配置文件呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!