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.
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.