WCF Configuration - Split it out of app.config

前端 未结 8 1607
耶瑟儿~
耶瑟儿~ 2020-12-10 02:38

I have a specific requirement to remove all client WCF configuration () out of the main app.config file, and into a separate XML file. The behav

8条回答
  •  自闭症患者
    2020-12-10 03:00

    I have an application at work that works kind of like what you're talking about here. We have multiple WCF services across multiple projects and all of their configuration information resides in a single config file.

    The solution my company chose was to read the service configuration out of the config file and then programmatically set up the bindings, behavior, etc based on the values read. The values in the config file don't conform to the config stuff you usually see in WCF services - it was designed to be easily used by a helper class to do all the configuration at run time.

    All that said, I'm not a big fan of doing that at all - too much coupling going on and it's pretty messy.

    It does, though, show that it's possible - it's one thing to think about in your design.

提交回复
热议问题