我有以下问题。我想要捕获如下所示的异常,而不是我得到NullReferenceException。有没有办法捕捉到这个Anonymous方法中抛出的异常?以匿名方式投掷(捕捉)异常
SynchronizationContext _debug_curr_ui = SynchronizationContext.Current;
_debug_curr_ui.Send(new SendOrPostCallback(delegate(object state) {
throw new Exception("RESONANCE CASCADE: GG-3883 hazardous material failure");
}),null);
我将不胜感激任何帮助。
如果你要扔,然后立即捕获并处理你可能也不会抛出呢? – TimC 2010-12-06 14:26:24