Skip to content

Commit 8978bc4

Browse files
jamescrosswellaritchiemartincostello
authored
fix: MSB4185: The function "IsWindows" on type "System.OperatingSystem" is not available (#4160)
* fix: MSB4185: The function "IsWindows" on type "System.OperatingSystem" is not available Resolves #4141: - #4141 When building .NET Framework applications, only whitelisted `System.*` property function invocations (e.g., `System.OperatingSystem.IsWindows()` are allowed). This PR avoid using an unlisted functions in the transitive build targets. --------- Co-authored-by: Allan Ritchie <allan.ritchie@gmail.com> Co-authored-by: Martin Costello <martin@martincostello.com>
1 parent 39e58f0 commit 8978bc4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

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

1212
- Work around iOS SHA1 bug ([#4143](https://github.com/getsentry/sentry-dotnet/pull/4143))
13+
- Fixes build error when building .NET Framework applications using Sentry 5.6.0: `MSB4185 :The function "IsWindows" on type "System.OperatingSystem" is not available` ([#4160](https://github.com/getsentry/sentry-dotnet/pull/4160))
1314

1415
### Dependencies
1516

src/Sentry/buildTransitive/Sentry.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<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" />
1616
</Target>
1717

18-
<ItemGroup Condition="$([System.OperatingSystem]::IsWindows())">
18+
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
1919
<!-- See: https://github.com/getsentry/sentry-dotnet/pull/4111 -->
2020
<LinkerArg Include="/NODEFAULTLIB:MSVCRT" />
2121
</ItemGroup>

0 commit comments

Comments
 (0)