2013-11-27 30 views
8

在ASP.NET中運行MassTransit時。一個NullReferenceException被拋出,按照這裏的問題報道: Google Discussion GroupThreadPoolConsumerPool中的MassTransit NullReferenceException

相關的細節
是否有人知道如何優雅地捕捉到了異常的AppDomain中重新加載時?

堆棧跟蹤僅竟把的MassTransit DLL:

NullReferenceException in ThreadPoolConsumerPool 

Locating source for 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'. (No checksum.) 
The file 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs' does not exist. 
Looking in script documents for 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'... 
Looking in the projects for 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'. 
The file was not found in a project. 
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'... 
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'... 
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'... 
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'... 
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs. 
The debugger could not locate the source file 'd:\BuildAgent-03\work\8d1373c869590c5b\src\MassTransit\Threading\ThreadPoolConsumerPool.cs'. 
+1

您可能想在此處添加討論的相關部分。只有鏈接的答案不適合本網站,我不相信只有鏈接的問題更好。 – nvoigt

+1

nvoigt - 我已經添加了相關的詳細信息 – Paul

+0

這只是一個懷疑,但我認爲Mass Transit會干擾ASP.NET用來處理請求的工作線程池。我們在使用異步委託從ASP.NET應用程序中調用Web服務時遇到了類似的問題 - 在高負載情況下,池最終耗盡,性能非常糟糕。它是在高負荷下發生還是總是發生? –

回答

1

你應該能夠趕上任何未捕獲的異常在Global.asax中: http://msdn.microsoft.com/en-us/library/24395wz3(v=vs.100).aspx

實施錯誤處理程序:

void Application_Error(object sender, EventArgs e) 

並標記處理的異常:

Server.ClearError(); 
+0

我已經試過了,它不會觸發 – Paul

+0

如果你發佈整個堆棧跟蹤,也許它會顯示異常發生在應用程序有機會連接錯誤處理程序之前。在這種情況下,您可能會延遲MT初始化,直到應用程序有機會設置。 –

+0

不,應用程序已明確通過application_start,並且每次發生這種情況時都會運行相當長的一段時間。 – Paul