在ASP.NET中运行MassTransit时。根据此处报告的问题,正在抛出NullReferenceException:
Google Discussion Group

相关详细信息
是否有人知道如何在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'.

最佳答案

您应该能够在global.asax中捕获任何未捕获的异常:
http://msdn.microsoft.com/en-us/library/24395wz3(v=vs.100).aspx

实现错误处理程序:

void Application_Error(object sender, EventArgs e)

并将异常标记为已处理:
Server.ClearError();

10-07 20:18