Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MassTransit NullReferenceException in ThreadPoolConsumerPool

When running MassTransit in ASP.NET. A NullReferenceException is being thrown, as per the issue reported here: Google Discussion Group

Relevant Detail
Does anybody know how to gracefully catch the exception when the AppDomain reloads?

The stack trace only goes as far as the 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'.
like image 580
Paul Avatar asked Nov 27 '13 10:11

Paul


1 Answers

You should be able to catch any uncaught exception in global.asax: http://msdn.microsoft.com/en-us/library/24395wz3(v=vs.100).aspx

Implement the error handler:

void Application_Error(object sender, EventArgs e)

and mark the exception as handled:

Server.ClearError();
like image 64
Eugene Tolmachev Avatar answered Sep 29 '22 14:09

Eugene Tolmachev