Configuring VSZ Files to Launch Wizards

Switch View :
ScriptFree
Visual Studio Automation and Extensibility 
Configuring VSZ Files to Launch Wizards 

Visual Studio uses a file type called .vsz to launch wizards. These files are text files with a .vsz extension that Visual Studio uses to determine the wizard to call and the information to pass to it, if any.

Comparison to INI File

A .vsz file is a simplified version of an .ini format text file, but it has no labeled sections. The first part stores information known to the Visual Studio environment. The second section allows parameters specific to the wizard to be collected by the environment and passed to the wizard.

Following is an example of a sample .vsz file:

VSWizard 8.0
Wizard=VIDWizard.CBlankSiteWizard
Param=<item1>
Param=<item2>
…
NoteNote

The Wizard value may also be a GUID in the format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} — 8,4,4,4,12.

The file has these parts:

  • VSWizard — This is the version number of the template file format, which for Visual Studio is "VSWizard 8.0." No other numbers are valid, and using other numbers results in an "Invalid Format" error.

  • Wizard — This is the programmatic ID (ProgID), such as MyWizard.MyClass, or alternately a string GUID representation of the CLSID of the Wizard that should be co-created by Visual Studio.

  • Param — These parameters are optional and you can add as many as your wizard requires. They are used to enable the .vsz file to pass additional custom parameters into the wizard. Each value is passed to the wizard as a string element in an array.

See Also

Community Content

Stephen Styrchak
Do not specify "VSWizard 8.0"

The description for the VSWizard part of the file is wrong. In Visual Studio 2005, specifying "VSWizard 8.0" will not work (the wizard will not be instantiated, and there will be no error).

Instead, specify 6.0, 7.0, or 7.1.

For example,

VSWizard 7.0
Wizard=VIDWizard.CBlankSiteWizard

 


Craig Skibo - MSFT
Creating replacement variables when linking to the Template Wizard

You can create replacement variables when a VSZ file references the VSTemplate wizard by adding Param entries to the .vsz file. The format of a string would be:

Param=ReplacementName=ReplacementValue

In this case, a replacement variable named $ReplacementName$ will be created in the dictionary with the value ReplacementValue.


Craig Skibo - MSFT
Using VSZ files to launch VSTemplate wizards

There may be times when you wish to launch a VSTemplate based wizard, and the template files are not stored in the traditional locations in a .zip file. An example of this is you have one template that you wish to make available for multiple languages (VB, C#, VC++, etc.) but do not want to store multiple copies of that template .zip file. You can create a VSZ that, when run, automatically launch the VSTemplate and start processing.

To do this, create a VSZ file and set the value of the Wizard argument to the value "{C28C4281-6E29-41AB-A120-9B6336BAC906}" (without quotes). The second requirement is that you have at least one Param value, and the first Param value must be set to the fully qualified path to the .vstemplate file to process.