-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
MSVCRT build warning when building Windows App SDK (WinUI) release binaries with native AOT #3928
Comments
Does WinUI support Native AOT? My understanding is that WinUI has its own AOT. If you remove Sentry, does it compile and run normally? |
Yes, WinUI 3 is bundled with the Windows App SDK, where Windows App SDK 1.6 has full support for Native AOT (as per the minimal project ZIP at the bottom of the report). Yep, when Sentry is removed, the warning disappears—the warning is specifically caused by placing the WinUI (with trimming) code inside the App.xaml.cs file, as per the minimal project. The issue seems to be that Sentry references |
Tricky... I'm wondering where the reference to MSVCRT comes from. The sentry-dotnet sdk doesn't have any dependencies for net8.0 or net9.0. It might be coming from the Sentry Native SDK (which we bundle/wrap for AOT compiled apps). The only explicit reference I can find to it there seems to be XBox specific though. Perhaps it's referenced implicitly somehow though. @vaind any ideas? |
Yes, this could be some part of the native SDK or it could be our native binding code: sentry-dotnet/src/Sentry/Platforms/Native/CFunctions.cs Lines 454 to 455 in 7faf221
I don't believe we've explicitly tested the WinUI+nativeAOT combination so that would be the first step, then we'd see what needs to be adapted. |
Package
Sentry
.NET Flavor
.NET
.NET Version
8.0.12
OS
Windows
SDK Version
5.0.1
Self-Hosted Sentry Version
No response
Steps to Reproduce
(Please find a minimal project attached below.)
Blank App, Packaged (WinUI 3 in Desktop)
, and add Sentry 5.0.1 as a NuGet package. Set the project to Release mode and apply Native AoT (right-click project > Properties > Build > Publish > enable Publish native AOT).During the Release build, after mentioning
Generating native code
, the build log will output the following warning:LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
I was able to discover this by using PowerShell:
Expected Result
No warning should appear in the build log.
Actual Result
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Minimal project (SentryAotTest.zip)
The text was updated successfully, but these errors were encountered: