1

I have a named pipe WCF connection where I have a timer elapsed heartbeat checking my connection is a live. The client and timer is running before my service and that is ok.

My code looks like below:

try
{
  serviceCallback = new ServiceCallback();
  serviceProxy = new ServiceProxy(serviceCallback);
  serviceChannel = serviceProxy.Channel;

  serviceChannel.HeartBeat();
}
catch(Exception exception)
{
}

If my service is not running the "serviceChannel.HeartBeat()" will throw an exception, and after a while my timer will ensure I try again.

It looks like there is no way checking the WCF before actually trying it. Is that correct?

I'm running with first chance exception in Visual Studio 2013, but can I do something in the code, to prevent the debugger to be triggered here? I have tried [DebuggerStepThrough] but without luck. Of course I can ignore this kind of exception in Visual Studio but I would prefer to only do it with this code.

JerryA
  • 153
  • 1
  • 8

0 Answers0