Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. WCF host instant and open programmatically - how to relate to binding in app.config?

WCF host instant and open programmatically - how to relate to binding in app.config?

Scheduled Pinned Locked Moved C#
questionwcftutorialcsharpwpf
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 1 Offline
    1 Offline
    1eyhk1
    wrote on last edited by
    #1

    hello For WCF host instantiated and opened programmatically - how to relate to binding in app.config? For example, here we get the channel open: using (ServiceHost host = new ServiceHost(typeof(GridControllerService))) { System.ServiceModel.WSDualHttpBinding binding = new WSDualHttpBinding(); binding.OpenTimeout = new TimeSpan(3, 0, 0); binding.CloseTimeout = new TimeSpan(3, 0, 0); binding.SendTimeout = new TimeSpan(3, 0, 0); binding.ReceiveTimeout = new TimeSpan(3, 0, 0); binding.MaxBufferPoolSize = 5000; host.AddServiceEndpoint(typeof(IGridControllerService), binding, "wsDualHttpBinding"); host.Open(); But instead of programmatically code up the binding config, we code have relate it to what's already in app.config <system.serviceModel> <bindings> <wsDualHttpBinding> <binding name="SomeHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" .... In this case, how can I relate "host" instantiated programmatically (yes weird why not do the whole deal in config right? But that's not my question) to "SomeHttpBinding" in config file. Thanks

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups