posts - 50, comments - 126, trackbacks - 6

My Links

News



View Marcin Celej's profile on LinkedIn

Archives

Post Categories

Checking if WCF service is configured in your app.config

When you need to startup WCF service conditionally - depending on your application configuration it is quite easy to achieve it by checking the ServiceHost.BaseAddresses collection. If your app.config file does not contain your service configured the collection will be empty. Here is the snippet:

ServiceHost host = new ServiceHost(typeof(MyService));
if (host.BaseAddresses.Count < 1)
     return;

host.Open();

Next time I will post how to plug-in service startup in your application startup with a plug-in model i described in my post Plugging-in application initialization code.

Print | posted on Wednesday, November 07, 2007 7:18 AM |

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: