From 849cc27da6df15255ba4a317f4ab10a1ada5de8d Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Fri, 11 Nov 2022 11:11:12 +0530 Subject: [PATCH] Fix Item update in Pack logic due to MSBuild regression - MSBuild Item update logic within target broke during 17.3-17.4! Previous logic referencing direct Item names worked fine before, but now needs a proxy/temporary item in order to process the includes. Same with the undefined Metadata, previously it returned empty string for items with the metadata undefined but now throws error. This may be correct behavior for items under target but this difference hinders sharing logic within and out of targets. This has a side-effect of needing to specify fully qualified name "%(Item.Metadata)" which makes it verbose. --- eng/Toolkit.GetBuildOutputs.targets | 4 ++-- eng/Toolkit.Packaging.targets | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eng/Toolkit.GetBuildOutputs.targets b/eng/Toolkit.GetBuildOutputs.targets index f360dffdb..25aa00415 100644 --- a/eng/Toolkit.GetBuildOutputs.targets +++ b/eng/Toolkit.GetBuildOutputs.targets @@ -28,10 +28,10 @@ - - + + diff --git a/eng/Toolkit.Packaging.targets b/eng/Toolkit.Packaging.targets index ae47b37d5..6491b60c4 100644 --- a/eng/Toolkit.Packaging.targets +++ b/eng/Toolkit.Packaging.targets @@ -78,10 +78,12 @@ - + <_NonReferencingProjectPackageFile Include="@(NonReferencingProjectBuildOutput->ClearMetadata())"> $([System.IO.Path]::Combine('analyzers', 'dotnet', '%(TargetCompiler)', '%(TargetLanguage)')) - $([System.IO.Path]::Combine('tools', '%(TargetFramework)')) - + $([System.IO.Path]::Combine('tools', '%(TargetFramework)')) + + + <_NonReferencingProjectPackageFile Remove="@(_NonReferencingProjectPackageFile)" />