From a4f9f978e381015fc3c867b2168646d3b261b1ae Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Wed, 7 Jan 2026 14:27:19 -0500 Subject: [PATCH] fix(sdk): fix VsixTemplateReference path computation Split the metadata computation into two ItemGroup updates because MSBuild cannot reference metadata that is set in the same update. Step 1 computes _ReferencedProjectDir and _TemplateFolderName. Step 2 uses those values to compute _FullTemplatePath and zip info. Closes #37 --- .../Sdk/Sdk.Vsix.Templates.targets | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.Templates.targets b/src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.Templates.targets index 416585b..8c5080d 100644 --- a/src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.Templates.targets +++ b/src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.Templates.targets @@ -70,11 +70,17 @@ <_ZipOutputPath>$(_VsixTemplateIntermediateOutputPath)ItemTemplates\%(VsixItemTemplate.TargetSubPath) - + <_ReferencedProjectDir>$([System.IO.Path]::GetDirectoryName('%(Identity)')) - <_FullTemplatePath>%(VsixTemplateReference._ReferencedProjectDir)\%(VsixTemplateReference.TemplatePath) <_TemplateFolderName>$([System.IO.Path]::GetFileName('%(VsixTemplateReference.TemplatePath)')) + + + + + + + <_FullTemplatePath>%(VsixTemplateReference._ReferencedProjectDir)\%(VsixTemplateReference.TemplatePath) <_ZipFileName>%(VsixTemplateReference._TemplateFolderName).zip <_ZipOutputPath Condition="'%(VsixTemplateReference.TemplateType)' == 'Project'">$(_VsixTemplateIntermediateOutputPath)ProjectTemplates\%(VsixTemplateReference.TargetSubPath) <_ZipOutputPath Condition="'%(VsixTemplateReference.TemplateType)' == 'Item'">$(_VsixTemplateIntermediateOutputPath)ItemTemplates\%(VsixTemplateReference.TargetSubPath)