File tree 2 files changed +13
-11
lines changed
src/Tasks/Microsoft.NET.Build.Tasks
2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -55,16 +55,16 @@ protected override void ExecuteCore()
55
55
56
56
bool selfContainedIsGlobalProperty = BuildEngine6 . GetGlobalProperties ( ) . ContainsKey ( "SelfContained" ) ;
57
57
58
- bool projectAcceptsRuntimeIdentifier = false ;
59
- if ( projectAdditionalProperties . TryGetValue ( "AcceptsRuntimeIdentifier " , out string acceptsRID ) &&
60
- bool . TryParse ( acceptsRID , out bool acceptsRIDParseResult ) )
58
+ bool projectIsRidAgnostic = true ;
59
+ if ( projectAdditionalProperties . TryGetValue ( "IsRidAgnostic " , out string isRidAgnostic ) &&
60
+ bool . TryParse ( isRidAgnostic , out bool isRidAgnosticParseResult ) )
61
61
{
62
- projectAcceptsRuntimeIdentifier = acceptsRIDParseResult ;
62
+ projectIsRidAgnostic = isRidAgnosticParseResult ;
63
63
}
64
64
65
- if ( selfContainedIsGlobalProperty && projectAcceptsRuntimeIdentifier )
65
+ if ( selfContainedIsGlobalProperty && ! projectIsRidAgnostic )
66
66
{
67
- // If AcceptsRuntimeIdentifier is true for the project , and SelfContained was set as a global property,
67
+ // If a project is NOT RID agnostic , and SelfContained was set as a global property,
68
68
// then the SelfContained value will flow across the project reference when we go to build it, despite the
69
69
// fact that we ignored it when doing the GetTargetFrameworks negotiation.
70
70
referencedProjectIsSelfContained = SelfContained ;
Original file line number Diff line number Diff line change @@ -79,12 +79,13 @@ Copyright (c) .NET Foundation. All rights reserved.
79
79
<PredefinedCulturesOnly Condition =" '$(PredefinedCulturesOnly)' == '' and '$(InvariantGlobalization)' == 'true'" >true</PredefinedCulturesOnly >
80
80
</PropertyGroup >
81
81
82
- <!-- Set the AcceptsRuntimeIdentifier property if this project should accept global RuntimeIdentifier and SelfContained
82
+ <!-- Set the IsRidAgnostic property if this project should NOT accept global RuntimeIdentifier and SelfContained
83
83
property values from referencing projects. -->
84
- <PropertyGroup Condition =" '$(AcceptsRuntimeIdentifier)' == '' And '$(IsTestProject)' != 'true'" >
85
- <AcceptsRuntimeIdentifier Condition =" '$(_IsExecutable)' == 'true' Or
86
- '$(RuntimeIdentifier)' != '' Or
87
- '$(RuntimeIdentifiers)' != ''" >true</AcceptsRuntimeIdentifier >
84
+ <PropertyGroup Condition =" '$(IsRidAgnostic)' == ''" >
85
+ <IsRidAgnostic Condition =" ('$(_IsExecutable)' == 'true' And '$(IsTestProject)' != 'true') Or
86
+ '$(RuntimeIdentifier)' != '' Or
87
+ '$(RuntimeIdentifiers)' != ''" >false</IsRidAgnostic >
88
+ <IsRidAgnostic Condition =" '$(IsRidAgnostic)' == ''" >true</IsRidAgnostic >
88
89
</PropertyGroup >
89
90
90
91
<!-- Opt into .NET Core resource-serialization strategy by default when targeting frameworks
@@ -1077,6 +1078,7 @@ Copyright (c) .NET Foundation. All rights reserved.
1077
1078
<ItemGroup >
1078
1079
<AdditionalTargetFrameworkInfoProperty Include =" SelfContained" />
1079
1080
<AdditionalTargetFrameworkInfoProperty Include =" _IsExecutable" />
1081
+ <AdditionalTargetFrameworkInfoProperty Include =" IsRidAgnostic" />
1080
1082
<AdditionalTargetFrameworkInfoProperty Include =" ShouldBeValidatedAsExecutableReference" />
1081
1083
</ItemGroup >
1082
1084
You can’t perform that action at this time.
0 commit comments