Skip to content

Null Exception on AddAspNet #1875

Closed
Closed
@lucas-zimerman

Description

@lucas-zimerman

Package

Sentry.AspNet

.NET Flavor

.NET

.NET Version

4.7

OS

Windows

SDK Version

3.20.1

Self-Hosted Sentry Version

No response

Steps to Reproduce

I was trying to figure out how to support Transactions for a OWIN application but it seems like when adding the AddAspNet to the code it throws a nullexception error.
The only plausible cause is the HttpContext being null here: https://github.com/getsentry/sentry-dotnet/blob/main/src/Sentry.AspNet/Internal/SystemWebVersionLocator.cs#L20

Expected Result

AddAspNet to not throw a null Exception

Actual Result

image
There are no line numbers :\

   at Sentry.AspNet.Internal.SystemWebVersionLocator.Resolve(HttpContext context)
   at Sentry.AspNet.SentryAspNetOptionsExtensions.AddAspNet(SentryOptions options, RequestSize maxRequestBodySize)

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions