You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#7995
Context
#6924 changed how IsRidAgnostic works. Normally, the .NET SDK should set the IsRidAgnostic property (added in dotnet/sdk#21986). But when using an older version of the .NET SDK, there is fallback logic in the GetTargetFrameworksWithPlatformForSingleTargetFramework target to replicate the previous logic.
However, this fallback logic was incorrect, as it was setting item metadata, but reading from the property to determine whether to set it to the default value. So if the property wasn't set, the IsRidAgnostic metadata would always be false.
Testing
Manual testing
<!-- Determine whether a project is "RID agnostic" for each TargetFramework. "RID agnostic" means that global properties such as SelfContained and RuntimeIdentifier should
1968
-
not flow across project references.
1969
-
1970
-
Generally this value will come from the IsRidAgnostic property set by the .NET SDK. If that's not set, then the fallback logic here will be that the project
1971
-
is RID agnostic if it doesn't have RuntimeIdentifier or RuntimeIdentifiers properties set. -->
1967
+
<!-- Determine whether a project is "RID agnostic" for each TargetFramework. "RID agnostic" means that global properties such as
1968
+
SelfContained and RuntimeIdentifier should not flow across project references. The IsRidAgnostic metadata value is consumed in the
1969
+
_GetProjectReferenceTargetFrameworkProperties target, where those properties are added to a project's UndefineProperties if
1970
+
IsRidAgnostic is set.
1971
+
1972
+
Generally we set the IsRidAgnostic metadata based on the IsRidAgnostic property set by the .NET SDK. If that's not set, then the
1973
+
fallback logic here will be that the project is RID agnostic if it doesn't have RuntimeIdentifier or RuntimeIdentifiers properties set. -->
1972
1974
<IsRidAgnostic>$(IsRidAgnostic)</IsRidAgnostic>
1973
-
<IsRidAgnosticCondition=" '$(IsRidAgnostic)' == '' and '$(RuntimeIdentifier)' == '' and '$(RuntimeIdentifiers)' == '' ">true</IsRidAgnostic>
0 commit comments