sentry-dotnet
sentry-dotnet copied to clipboard
Add Roslyn analyzer to warn of uncaught exception with async main
To address: https://github.com/getsentry/sentry-dotnet/issues/321
The user must have a try/catch block at the top level async Main
Relates to #751
this should no longer be an issue with https://github.com/getsentry/sentry-dotnet/pull/1646 @mattjohnsonpint will update the docs: https://docs.sentry.io/platforms/dotnet/troubleshooting/#unhandled-exceptions-are-not-captured-when-using-an-async-main-method
@SimonCropp, I tried with latest with code similar to what I wrote in the troubleshooting docs, and it still fails. I don't think we fixed it.
Thinking through this more, combining async main with exceptions and using blocks is the issue. It's not about Sentry in particular, but rather a general issue with .NET development. It would be a great suggestion for https://github.com/dotnet/roslyn-analyzers