Add-on components that enhance and customize the Visual Studio integrated development environment
The .NET template engine (template.json) itself does not support adding custom Visual Studio UI controls, dynamic multi-page wizards, or arbitrary extra dialogs. It is limited to the standard parameter collection experience that Visual Studio provides (the built-in “Configure your new project” / “Additional information” page).
To get a richer, multi-step wizard experience with custom UI and logic when creating a project in Visual Studio, a custom wizard must be implemented using the Visual Studio extensibility model, not just template.json.
Visual Studio supports this via the IWizard interface and project templates packaged in a VSIX:
- Implement
Microsoft.VisualStudio.TemplateWizard.IWizardin an assembly. - Package that assembly in a VSIX.
- Connect the wizard to a project template by adding a
<WizardExtension>section to the.vstemplatefile of the project template:
<WizardExtension>
<Assembly>MyProjectWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=token</Assembly>
<FullClassName>MyProjectWizard.WizardImplementation</FullClassName>
</WizardExtension>
- In the
WizardImplementationclass, useRunStarted(and otherIWizardmethods if needed) to:- Display custom UI (for example, Windows Forms) to collect user input.
- Add custom parameter values into the
Dictionary<string, string>of template parameters. - Use those parameters in the template source via
$parameterName$substitutions.
The IWizard approach allows:
- Custom UI: any Windows Forms or WPF dialog(s) can be shown, with arbitrary controls (dropdowns, checkboxes, conditional fields, etc.).
- Multi-step / multi-page flows: multiple forms can be shown in sequence, implementing Next/Back logic as desired before the project is created.
- Dynamic behavior: values can be computed at runtime, additional files can be added, and the project can be customized programmatically.
In summary:
-
template.jsonalone cannot define extra Visual Studio UI pages or multi-step wizards. - For rich, multi-page project creation in Visual Studio 2022, a VSIX-based project template with an
IWizardimplementation and a.vstemplatefile must be used.
References: