2012-04-25 59 views

回答

6

有一兩件事你可以嘗試,除了DispatcherUnhandledException是偵聽例外從AppDomain中來

AppDomain.CurrentDomain.UnhandledException += 
     new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 

這應,在理論上,搭上關係到你的應用程序的所有異常,而不僅僅是那些內運行調度員。

2

你嘗試也添加到您的應用程序啓動?:

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 
0

根據我的經驗,如果只有部分用戶收到錯誤(和這些用戶得到的錯誤所有的時間),那麼很可能是該項目文件引用dll的沒有將'CopyToLocal'屬性設置爲true - 因此假設所有用戶都已將dll安裝在GAC中 - 對於某些用戶來說可能並非如此。

0

如果你的處理程序被調用,但仍然異常未處理的,有必要對事件進行處理:e.Handled=true;看到:How to suppress UI exceptions in wpf?

+0

異常處理,我認爲tomasmcguinness和Dummy01提出的解決方案就能解決問題 – torpederos 2012-04-25 13:29:45