I have WCF Service-client, On Service side, If unhandled exception is thrown, the channel will get faulted, After channel is faulted i have to recreate the client side.
When i create the client i use ChannelFactory, so i need to .Abort the current channel and then create it again.
What is the benefit of doing Try Catch with Fault Exception on service side ? it wont fault the channel ?
- My managed application contains several ServiceHost opened, How can i register their faulted state and restart a certain service from the Event Handler?
Code:
...
serviceHost.Faulted+=serviceHost_Faulted;
...
private static void serviceHost_Faulted(object sender, EventArgs e)
{
//How to detect the channel information ? can i cast sender to and know its implemented IService interface ?
}