your asynchronous method threw”. I followed the same approach in my Asynchronous long-running tasks in ASP.NET application
IAsyncResult asyncResult = dlgt.BeginInvoke(params, null, asyncState);
if (bRet == false)
Debug.Assert(false, “To Implement”);
catch (Exception exc)
EventSources.RaiseErrorMessage(EventSources.MyEventSource, message, ExceptionSeverity.Error, exc);
In production (Release mode without any debugging) it seems that catch block is invoked(I can see event log entries).
The discussion Exceptions in asynchronous delegates suggests to change VS setting to avoid the message. However I feel that more reliable approach will be catch (and log) all exceptions in the delegate function to ensure that they are not thrown asyncronously.
Strange: calling EndInvoke from an AsyncCallback – why UnhandledException -too long and WinForms specific.