-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions not captured since updating to 3.4.0 or above #1050
Comments
Hi! Where was the exception thrown? Inside an endpoint or somewhere else? |
@Camble Running the sample in the repo works fine: Could you please share a repro so we can investigate? If you set the SDK in Debug mode, anything shows on the log to indicate the problem? Is this .NET Core 2.1, 3.1, 5.0? Or else? |
@Tyrrrz Inside an endpoint, but I tried capturing a test message from various places using the SentrySdk static class. @bruno-garcia I'm unable to share the exact repo, but I can try to reproduce in a new project. I'll investigate further. Thanks. |
Thanks @Camble . With a repro in hand we can debug it to find out what's going on. But the tests we did with our samples, we couldn't reproduce it. |
Same problem here; here's a repro: The unhandled exception is not captured when the following project config is used: <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Sentry.AspNetCore" Version="3.5.0" />
</ItemGroup>
</Project> The unhandled exception is captured with either of these combos:
|
Thanks for the repro! I debugged the issue and it looks like Sentry is crashing in sentry-dotnet/src/Sentry/SentryClient.cs Lines 220 to 223 in f84c23b
With this exception:
Judging by the stacktrace, it looks like Edit: we DO have this package as a dependency, but only on .NET Standard 2.0, not .NET Core 3.1 target: I don't see anything related in our changelog between 3.3.4 and 3.5.0 so it's probably just a submodule bump that caused this? cc @bruno-garcia |
Relevant StackOverflow question: https://stackoverflow.com/questions/68019132/sentry-exception-logging-net-core |
We haven't changed the submodule since the time we added, 5 months ago: https://github.com/getsentry/sentry-dotnet/commits/main/modules so unchanged since SDK version 3.0.0. I wonder how does it compile if the type is not present on .NET Core 3.x? Seems odd. Here's the diff between 3.3.4 and 3.4.0 (first version you can reproduce the error):
We don't rely on the I'm not sure how tests pass though. WorkaroundAdd a dependency: |
We've added it as a dependency explicitly to work around this issue. It's available on our latest preview: https://github.com/getsentry/sentry-dotnet/releases/tag/3.6.0-alpha.2 Again, workaround for you without the need to upgrade the Sentry SDK: Add a dependency: |
Version 3.6.0 was already released with this fix: https://www.nuget.org/packages/Sentry/3.6.0 |
Hey guys, I was looking the new version of Sentry.AspNetCore and looks like the dependency for System.Reflection.Metadata is not present on .NET Core 3.x again. I tried the workaround and it worked, so maybe it was unintended removed? Link for the new version: https://www.nuget.org/packages/Sentry/3.30.0#dependencies-body-tab |
@SirSalamandra - Thanks. I'll take a look asap. |
Restored in #2302. Adding the dependency manually to your project should be fine in the meantime. Thanks. |
Environment
How do you use Sentry?
Sentry SaaS
Which SDK and version?
Sentry.AspNetCore 3.4.0 & 3.5.0
Steps to Reproduce
Installed & configured Sentry SDK 3.5.0 on a new ASP.NET Core 3.1 Web API.
Using webBuilder.UseSentry() in Program.cs
Configuration in appsettings.json, but also tried hardcoding values.
Expected Result
Test exception to be captured
Actual Result
No exceptions captured.
Rolled back to known working version (3.3.4) and this resolved the issue.
The text was updated successfully, but these errors were encountered: