Skip to content

Conversation

@CalvinAllen
Copy link
Contributor

Summary

Exclude ProjectTemplates/ and ItemTemplates/ folders from default compilation.

Problem

Template files contain VS template placeholders ($safeprojectname$, $guid1$, etc.) that are not valid C# syntax. When these folders are in a VSIX project, the .NET SDK tries to compile them, causing build errors.

Solution

Add the template folders to DefaultItemExcludes in Sdk.Vsix.Templates.props:

<DefaultItemExcludes>$(DefaultItemExcludes);$(VsixProjectTemplatesFolder)\**;$(VsixItemTemplatesFolder)\**</DefaultItemExcludes>

This uses the configurable folder properties, so custom folder locations are also excluded.

Template files contain VS template placeholders ($safeprojectname$, etc.)
that are not valid C# and should not be compiled as part of the extension.

This adds ProjectTemplates/** and ItemTemplates/** to DefaultItemExcludes.
@CalvinAllen CalvinAllen merged commit f8ccedd into main Jan 7, 2026
3 checks passed
@CalvinAllen CalvinAllen deleted the fix/sdk/exclude-template-folders-from-compilation branch January 7, 2026 18:57
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.

2 participants