runtime: Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll

No clue what this is about.

Setup:

  • ASP.NET Core 3.0 (.NET Core version: 3.1.100-preview3-014645)
  • MVC application

This is logged to the output window: Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll

See screenshot.

It would be good to know where this is coming from and why?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (14 by maintainers)

Most upvoted comments

I feel either you or I are from a different planet. You never seem to get the point am trying to make. I would rather not communicate with you in future.

Thank you for your time.

  • Sent from mobile. Pardon typos.

If an exception goes unhandled enough to print it out, the app is also going to crash, but this discussion suggests the app isn’t crashing. Such printing from the runtime also prints the stack trace, and uses a different format.

The app was not crashing in this case. The code that was causing the exception (an [int] count++; inside a Parallel.ForEach() was simply causing that particular parallel thread to exit – possibly the AggregateException was wrapping a thread abort or something here.

The problem is, Visual Studio 2019’s tooling for debugging parallel threads suck! (its freeze/thaw of threads don’t work anymore). So this took quite some doing to unravel.

Anyway, thank you.

This is logged to the output window

Ah, that looks like it’s VS’ logging for 1st-chance exceptions, meaning it’s logging when an exception is thrown even if it’s caught and handled.