Skip to content

Conversation

@CalvinAllen
Copy link
Contributor

Summary

Fix the VsixTemplateReference path computation bug that caused templates from referenced projects to fail zipping.

Problem

MSBuild cannot reference metadata that is set in the same ItemGroup update. The original code tried to set _ReferencedProjectDir and immediately use it to compute _FullTemplatePath in the same update, resulting in an empty/incorrect path.

Solution

Split the metadata computation into two separate ItemGroup updates:

  • Step 1: Compute _ReferencedProjectDir and _TemplateFolderName
  • Step 2: Use those values to compute _FullTemplatePath, _ZipFileName, and _ZipOutputPath

Testing

Verified locally that VsixTemplateReference now correctly resolves paths like:

..\E2E.Templates.SharedSource\Templates\SharedProject

instead of the broken:

C:\Templates\SharedProject

Closes #37

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
@CalvinAllen CalvinAllen merged commit 53be6c3 into main Jan 7, 2026
3 checks passed
@CalvinAllen CalvinAllen deleted the fix/sdk/vsixtemplatereference-path branch January 7, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

fix(sdk): VsixTemplateReference path computation is broken

2 participants