This issue has to do with the DispatchDebugMessages path, which attempts to invoke a managed method on a C++ Concurrency Runtime worker thread.
That seems to work in desktop applications, but it throws a CLR-internal C++ exception in ASP.NET. The unhandled exception triggers fail-fast handling in the task infrastructure.
A potential fix might be to schedule debug message dispatch on the managed side, ensuring that the worker thread is safe for invoking managed code.
Comments: Fixed in [Version 5.4.2](https://clearscript.codeplex.com/SourceControl/changeset/bfd06449d9e70818985d855319b7bc3a955313aa).
That seems to work in desktop applications, but it throws a CLR-internal C++ exception in ASP.NET. The unhandled exception triggers fail-fast handling in the task infrastructure.
A potential fix might be to schedule debug message dispatch on the managed side, ensuring that the worker thread is safe for invoking managed code.
Comments: Fixed in [Version 5.4.2](https://clearscript.codeplex.com/SourceControl/changeset/bfd06449d9e70818985d855319b7bc3a955313aa).