我有一些困难,我在测试过程中捕捉异常。我实际上断开了该服务,使端点不可用,并且我试图修改我的应用程序以处理这种可能性。我在哪里可以捕获异步WCF调用的EndpointNotFoundException?
的问题是,无论在哪里我把try/catch块,我似乎无法赶上这个东西它到达之前未处理。
我已经试过包装在try/catch语句我的两个创建代码,
this.TopicServiceClient = new KeepTalkingServiceReference.TopicServiceClient();
this.TopicServiceClient.GetAllTopicsCompleted += new EventHandler<KeepTalkingServiceReference.GetAllTopicsCompletedEventArgs>(TopicServiceClient_GetAllTopicsCompleted);
this.TopicServiceClient.GetAllTopicsAsync();
以及服务调用完成时调用的委托。
public void TopicServiceClient_GetAllTopicsCompleted(object sender, KeepTalkingServiceReference.GetAllTopicsCompletedEventArgs e)
{
try
{
...
没有骰子。有什么想法吗?