Skip to content

.NET 9 Support #3484

@atomsk-0

Description

@atomsk-0

Package

Sentry

.NET Flavor

.NET

.NET Version

9.0.100-preview.6.24328.19

OS

Windows

SDK Version

4.9.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. add <PublishAot>true</PublishAot> to csproj
  2. run dotnet publish -c Release -r win-x64
  3. try run program

Expected Result

Program starting up normally

Actual Result

Throws this exception when trying to init sentry sdk. (Works normally without PublishAot flag enabled

System.DllNotFoundException: Unable to load DLL 'sentry-native' or one of its dependencies: The specified module could not be found.
   at System.Runtime.InteropServices.NativeLibrary.LoadLibErrorTracker.Throw(String) + 0x50
   at Internal.Runtime.CompilerHelpers.InteropHelpers.FixupModuleCell(InteropHelpers.ModuleFixupCell*) + 0x10e
   at Internal.Runtime.CompilerHelpers.InteropHelpers.ResolvePInvokeSlow(InteropHelpers.MethodFixupCell*) + 0x2f
   at Sentry.Native.C.sentry_options_new() + 0x32
   at Sentry.Native.C.Init(SentryOptions) + 0x2c
   at Sentry.SentrySdk.InitNativeSdk(SentryOptions) + 0x2b
   at Sentry.SentrySdk.InitHub(SentryOptions) + 0x1d2
   at Sentry.SentrySdk.Init(Action`1) + 0x37
   at Sensum.Utils.SentryClient.Setup() + 0x4e
   at Sensum.Program.Main(String[] args) + 0x16c

Metadata

Metadata

Labels

No fields configured for issues without a type.

Projects

Status

Done

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions