Skip to content

Commit e10c6d5

Browse files
authored
Move setting /NODEFAULTLIB:MSVCRT LinkerArg to windows-specific targets in Sentry.Native.targets (#4760)
1 parent 959a506 commit e10c6d5

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Captured [Http Client Errors](https://docs.sentry.io/platforms/dotnet/guides/aspnet/configuration/http-client-errors/) on .NET 5+ now include a full stack trace in order to improve Issue grouping ([#4724](https://github.com/getsentry/sentry-dotnet/pull/4724))
1212
- Sentry Tracing middleware crashed ASP.NET Core in .NET 10 in 6.0.0-rc.1 and earlier ([#4747](https://github.com/getsentry/sentry-dotnet/pull/4747))
13+
- Avoid appending `/NODEFAULTLIB:MSVCRT` to NativeAOT linker arguments on Windows when targetting non-Windows platforms (Android, Browser) ([#4760](https://github.com/getsentry/sentry-dotnet/pull/4760))
1314

1415
### Dependencies
1516

src/Sentry/Platforms/Native/buildTransitive/Sentry.Native.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
<ItemGroup Condition="'$(FrameworkSupportsNative)' == 'true' and ('$(RuntimeIdentifier)' == 'win-x64' or '$(RuntimeIdentifier)' == 'win-arm64')">
4545
<DirectPInvoke Include="sentry-native" />
46+
<!-- See: https://github.com/getsentry/sentry-dotnet/pull/4111 -->
47+
<LinkerArg Include="/NODEFAULTLIB:MSVCRT" />
4648
<NativeLibrary Include="$(MSBuildThisFileDirectory)..\sentry-native\$(RuntimeIdentifier)\sentry-native.lib" />
4749
<NativeLibrary Include="dbghelp.lib" />
4850
<NativeLibrary Include="winhttp.lib" />

src/Sentry/buildTransitive/Sentry.targets

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
<Error Text="Android projects using Sentry cannot build using AndroidEnableAssemblyCompression = false due to a Microsoft issue. Please follow https://github.com/dotnet/android/issues/9752" />
2828
</Target>
2929

30-
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows')) AND '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true'">
31-
<!-- See: https://github.com/getsentry/sentry-dotnet/pull/4111 -->
32-
<LinkerArg Include="/NODEFAULTLIB:MSVCRT" />
33-
</ItemGroup>
34-
3530
<Target Name="WriteSentryAttributes"
3631
Condition="$(Language) == 'VB' or $(Language) == 'C#' or $(Language) == 'F#'"
3732
BeforeTargets="BeforeCompile;CoreCompile"

0 commit comments

Comments
 (0)