Skip to content

Commit

Permalink
Handle consuming AcceptsRuntimeIdentifier metadata from multi-targete…
Browse files Browse the repository at this point in the history
…d projects
  • Loading branch information
dsplaisted committed Jul 22, 2022
1 parent 3135126 commit e2297ee
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ protected override void ExecuteCore()

bool selfContainedIsGlobalProperty = BuildEngine6.GetGlobalProperties().ContainsKey("SelfContained");

if (selfContainedIsGlobalProperty && project.GetBooleanMetadata("AcceptsRuntimeIdentifier") == true)
bool projectAcceptsRuntimeIdentifier = false;
if (projectAdditionalProperties.TryGetValue("AcceptsRuntimeIdentifier", out string acceptsRID) &&
bool.TryParse(acceptsRID, out bool acceptsRIDParseResult))
{
projectAcceptsRuntimeIdentifier = acceptsRIDParseResult;
}

if (selfContainedIsGlobalProperty && projectAcceptsRuntimeIdentifier)
{
// If AcceptsRuntimeIdentifier is true for the project, 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
Expand Down

0 comments on commit e2297ee

Please sign in to comment.