You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Remove VsixTemplateZip item type and related targets (VSSDK handles
template packaging natively when Content entries are in manifest)
- Keep VsixTemplateReference for cross-project templates (copies folders
from referenced projects to local ProjectTemplates/ItemTemplates)
- Add proper VSIXSubPath metadata so copied templates are placed at
correct paths in the VSIX
- Update E2E tests: remove PreBuiltZip, add Reference and ReferenceManual
- Update workflow to verify new template reference tests
- Update documentation to reflect simplified template handling
Closes#39
Copy file name to clipboardExpand all lines: docs/templates.md
+37-55Lines changed: 37 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,27 @@ This document explains how to include Visual Studio project templates and item t
6
6
7
7
The built-in VSIX Manifest Designer in Visual Studio cannot enumerate SDK-style projects when adding template assets. This is because the designer uses legacy DTE extenders that are registered for the old project system, not the Common Project System (CPS) used by SDK-style projects.
8
8
9
-
Additionally, SDK-style projects don't define the `TemplateProjectOutputGroup` and `ItemTemplateOutputGroup` MSBuild output groups that VSSDK expects for template assets.
9
+
This SDK provides MSBuild-based template support that works around these limitations by:
10
+
- Auto-discovering templates in standard folders
11
+
- Supporting cross-project template references
12
+
- Providing validation warnings for missing manifest Content entries
10
13
11
-
This SDK provides MSBuild-based template support that bypasses these limitations entirely.
14
+
## How It Works
15
+
16
+
VSSDK (the Visual Studio SDK build tools) handles the actual template packaging when your manifest contains `<Content><ProjectTemplate/></Content>` entries. This SDK provides:
17
+
18
+
1.**Auto-discovery** of templates for validation
19
+
2.**Cross-project template references** for including templates from other SDK-style projects
20
+
3.**Validation warnings** if your manifest is missing required Content entries
12
21
13
22
## Item Types
14
23
15
-
The SDK provides four item types for including templates:
24
+
The SDK provides the following item types for templates:
16
25
17
26
| Item Type | Description |
18
27
|-----------|-------------|
19
-
|`VsixProjectTemplate`| A folder containing a `.vstemplate` file for a project template |
20
-
|`VsixItemTemplate`| A folder containing a `.vstemplate` file for an item template |
21
-
|`VsixTemplateZip`| A pre-built template zip file |
28
+
|`VsixProjectTemplate`| (Auto-discovered) A folder containing a `.vstemplate` file for a project template |
29
+
|`VsixItemTemplate`| (Auto-discovered) A folder containing a `.vstemplate` file for an item template |
22
30
|`VsixTemplateReference`| Reference a template folder from another project |
23
31
24
32
## Auto-Discovery
@@ -45,10 +53,12 @@ MyExtension/
45
53
MyClass.cs
46
54
```
47
55
48
-
With this structure, no additional configuration is needed. The SDK will:
56
+
With this structure, minimal configuration is needed. The SDK will:
49
57
1. Find the templates automatically
50
-
2. Zip each template folder during build
51
-
3. Include the zips in the VSIX at `ProjectTemplates/` and `ItemTemplates/`
58
+
2. Warn if `<Content>` entries are missing from the manifest
59
+
3. VSSDK packages the templates into the VSIX
60
+
61
+
You need to add the Content entries to your manifest manually (see Manifest Configuration below).
52
62
53
63
### Disabling Auto-Discovery
54
64
@@ -71,33 +81,9 @@ To use different folder names:
71
81
</PropertyGroup>
72
82
```
73
83
74
-
## Manual Template Configuration
75
-
76
-
### Folder-Based Templates
84
+
## Cross-Project Template References
77
85
78
-
If your templates are in non-standard locations, add them explicitly:
@@ -217,14 +196,17 @@ To organize templates into subfolders within the VSIX:
217
196
### Templates not appearing in Visual Studio
218
197
219
198
1. Ensure your manifest has the appropriate `<Content>` entries
220
-
2. Check that the template zip files are included in the VSIX (open the .vsix as a zip)
199
+
2. Check that the template folders are included in the VSIX (open the .vsix as a zip)
221
200
3. Verify the `.vstemplate` file has correct `<ProjectType>` or `<TemplateGroupID>`
222
201
4. Reset the Visual Studio template cache: delete `%LocalAppData%\Microsoft\VisualStudio\<version>\ComponentModelCache`
223
202
224
203
### Build errors about missing template folders
225
204
226
205
Ensure the template folder exists and contains a `.vstemplate` file. For `VsixTemplateReference`, verify the `TemplatePath` is correct relative to the referenced project.
227
206
228
-
### Templates in wrong location in VSIX
207
+
### Cross-project templates not working
229
208
230
-
Check the `TargetSubPath` metadata if you're using custom paths. By default, templates are placed directly in `ProjectTemplates/` or `ItemTemplates/`.
209
+
1. Verify the referenced project path is correct
210
+
2. Check that `TemplateType` is set to `Project` or `Item`
211
+
3. Ensure `TemplatePath` points to a folder containing a `.vstemplate` file
212
+
4. The template folder will be copied to your local `ProjectTemplates/` or `ItemTemplates/` folder during build
0 commit comments