Skip to content

Commit 6ac811e

Browse files
committed
fix(sdk): include auto-discovered templates in VSIX
Add Content items for auto-discovered project and item templates so they are included in the VSIX package. The removal of template zipping also removed the mechanism that added templates to the VSIX, which broke auto-discovery scenarios.
1 parent c54f180 commit 6ac811e

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.Templates.targets

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,28 @@
3737
<_TemplateFolderName>%(_DiscoveredItemTemplateFiles.Filename)</_TemplateFolderName>
3838
</VsixItemTemplate>
3939
</ItemGroup>
40+
41+
<!--
42+
Include all files from discovered template folders in the VSIX.
43+
Templates are added as folders (not zipped) for VSSDK compatibility.
44+
-->
45+
<ItemGroup Condition="'@(_DiscoveredProjectTemplateFiles)' != ''">
46+
<_ProjectTemplateFiles Include="$(MSBuildProjectDirectory)\$(VsixProjectTemplatesFolder)\**\*" />
47+
<Content Include="@(_ProjectTemplateFiles)">
48+
<IncludeInVSIX>true</IncludeInVSIX>
49+
<VSIXSubPath>$(VsixProjectTemplatesFolder)\%(RecursiveDir)</VSIXSubPath>
50+
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
51+
</Content>
52+
</ItemGroup>
53+
54+
<ItemGroup Condition="'@(_DiscoveredItemTemplateFiles)' != ''">
55+
<_ItemTemplateFiles Include="$(MSBuildProjectDirectory)\$(VsixItemTemplatesFolder)\**\*" />
56+
<Content Include="@(_ItemTemplateFiles)">
57+
<IncludeInVSIX>true</IncludeInVSIX>
58+
<VSIXSubPath>$(VsixItemTemplatesFolder)\%(RecursiveDir)</VSIXSubPath>
59+
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
60+
</Content>
61+
</ItemGroup>
4062
</Target>
4163

4264
<!--

0 commit comments

Comments
 (0)