-
-
Notifications
You must be signed in to change notification settings - Fork 226
Description
I think there might be a problem with how/when we enable the Native SDK. According to the docs IsTargetFrameworkCompatible returns true if the "Candidate" (second argument) is compatible with the "Target" (first argument).
These seem to be reversed here:
| <FrameworkSupportsNative Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) and ('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe')">true</FrameworkSupportsNative> |
If they're not reversed, that IsTargetFrameworkCompatible function is just plain confusing (and thus error prone) and I think we should just avoid using it.
I had some issues with this elsewhere and added a more reliable (and understandable) way of doing minimum version checks:
sentry-dotnet/Directory.Build.props
Line 112 in 845de33
| <TargetFrameworkIsNet9OrGreater Condition="$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 9.0))">true</TargetFrameworkIsNet9OrGreater> |
We could potentially add TargetFrameworkIsNet8OrGreater as well and use that to conditionally enable Native support instead.
Metadata
Metadata
Assignees
Labels
Projects
Status