Click here to Skip to main content
15,885,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I'm trying write a console host for my WCF Demo. The settings for the ServiceHost object are specified in System.ServiceModel configuration section in app.config.

Goal
Have my "Service" hosted with two different set of configurations. For example, ServiceHost instance 1 at http://localhost:8080 will be unsecured, while ServiceHost instance 2 at
http://localhost:8081 will be secured through certs.

Issue

The service element in config file requires the full name of your Service class so that ServiceHost instance in code can read the configuration values.

Is there a way to specify to two sets of service element for the same service through configuration?

I can probably (needs to test) can achieve this by building the WCF object model myself in the code or have two different instances of the console app running with different configurations.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900