diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ValidateExecutableReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ValidateExecutableReferences.cs
index 686b0591f320..6bf05749558b 100644
--- a/src/Tasks/Microsoft.NET.Build.Tasks/ValidateExecutableReferences.cs
+++ b/src/Tasks/Microsoft.NET.Build.Tasks/ValidateExecutableReferences.cs
@@ -55,16 +55,16 @@ protected override void ExecuteCore()
bool selfContainedIsGlobalProperty = BuildEngine6.GetGlobalProperties().ContainsKey("SelfContained");
- bool projectAcceptsRuntimeIdentifier = false;
- if (projectAdditionalProperties.TryGetValue("AcceptsRuntimeIdentifier", out string acceptsRID) &&
- bool.TryParse(acceptsRID, out bool acceptsRIDParseResult))
+ bool projectIsRidAgnostic = true;
+ if (projectAdditionalProperties.TryGetValue("IsRidAgnostic", out string isRidAgnostic) &&
+ bool.TryParse(isRidAgnostic, out bool isRidAgnosticParseResult))
{
- projectAcceptsRuntimeIdentifier = acceptsRIDParseResult;
+ projectIsRidAgnostic = isRidAgnosticParseResult;
}
- if (selfContainedIsGlobalProperty && projectAcceptsRuntimeIdentifier)
+ if (selfContainedIsGlobalProperty && !projectIsRidAgnostic)
{
- // If AcceptsRuntimeIdentifier is true for the project, and SelfContained was set as a global property,
+ // If a project is NOT RID agnostic, and SelfContained was set as a global property,
// then the SelfContained value will flow across the project reference when we go to build it, despite the
// fact that we ignored it when doing the GetTargetFrameworks negotiation.
referencedProjectIsSelfContained = SelfContained;
diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
index af69938c62d4..b09eebd44d49 100644
--- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
+++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
@@ -79,12 +79,13 @@ Copyright (c) .NET Foundation. All rights reserved.
true
-
-
- true
+
+ false
+ true