Where to trap failed connection on WCF calling class?

后端 未结 7 1196
失恋的感觉
失恋的感觉 2021-01-13 05:09

I\'m trying to write a class that encapsulates WCF calls (the client is Silverlight, if it matters). It all works swimmingly, but I\'m not sure how to trap a connection fail

7条回答
  •  萌比男神i
    2021-01-13 05:34

    Jeff, please show us your code when you try to put a try/catch block around the EndGet call. It's hard to believe that doesn't catch an exception, and seeing it will help me believe.

    Also, as part of this experiment, get rid of the UnhandledException event handler. I think you're catching this exception as soon as the BrowserHttpRequest realizes there's a 404. I think that without the UnhandledException event, a try/catch around EndGet will catch the exception, if any. I think you're picking up an intermediate state of the exception handling process.

    I'd also like to see you put a System.Debugger.Break or something immediately after the EndGet call.

提交回复
热议问题