locked
How to realize configuration ? RRS feed

  • Question

  • User-1350516731 posted

    What is the best  way (and why?) for configuration - realize it in logic code or in configuration file using xml ?

    Sunday, April 13, 2014 7:35 AM

Answers

  • User-417640953 posted

    Hi Alex9,

    Thank you post the issue to asp.net forum.

    When developing a WCF service, we can set the necessary information with coressponding class object.

    Also so we can set that information in a configure file. Personly, I think we would better save the object property in the configure file.

    Configuring a Windows Communication Foundation (WCF) service with a configuration file gives you the flexibility of providing endpoint

    and service behavior data at the point of deployment instead of at design time. A WCF service is configurable using the .NET Framework configuration technology.

    Most commonly, XML elements are added to the Web.config file for an Internet Information Services (IIS) site that hosts a WCF service.

    http://msdn.microsoft.com/en-us/library/ms733932(v=vs.110).aspx

    There is a tools for editing wcf configuration SvcConfigEditor.exe, Service Configuration Editor comes with a wizard that guides you through all the steps

    in configuring a WCF service or client. You are strongly advised to use the wizard instead of the editor directly.

    http://msdn.microsoft.com/en-us/library/ms732009(v=vs.110).aspx

    Hope that helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 12:49 AM

All replies

  • User364480375 posted

    hey want to get config of something??

    Sunday, April 13, 2014 8:25 AM
  • User-1350516731 posted

    Start configuration of WCF service.

    Sunday, April 13, 2014 9:42 AM
  • Sunday, April 13, 2014 9:44 AM
  • User-1350516731 posted

    I readed about it. But I dont understand what way to configure is the best approach and most widely used.

    Sunday, April 13, 2014 11:46 AM
  • User-417640953 posted

    Hi Alex9,

    Thank you post the issue to asp.net forum.

    When developing a WCF service, we can set the necessary information with coressponding class object.

    Also so we can set that information in a configure file. Personly, I think we would better save the object property in the configure file.

    Configuring a Windows Communication Foundation (WCF) service with a configuration file gives you the flexibility of providing endpoint

    and service behavior data at the point of deployment instead of at design time. A WCF service is configurable using the .NET Framework configuration technology.

    Most commonly, XML elements are added to the Web.config file for an Internet Information Services (IIS) site that hosts a WCF service.

    http://msdn.microsoft.com/en-us/library/ms733932(v=vs.110).aspx

    There is a tools for editing wcf configuration SvcConfigEditor.exe, Service Configuration Editor comes with a wizard that guides you through all the steps

    in configuring a WCF service or client. You are strongly advised to use the wizard instead of the editor directly.

    http://msdn.microsoft.com/en-us/library/ms732009(v=vs.110).aspx

    Hope that helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 15, 2014 12:49 AM
  • User-488622176 posted

    There is no best way. If you think you should change the config settings one day, you better put it in a config file. It allows modifications without a rebuild of your code.

    Tuesday, April 15, 2014 4:26 AM