VSDir Files

A VSDir file ** is a text file with a .vsdir extension that provides information to the Add Item and New Project dialog boxes about how to display its items, such as their names, the order in which they appear, and the icon displayed with them. You can have multiple VSDir files in a single directory, but typically, a single VSDir file contains records for multiple Wizards, folders, and templates. Each record in the file is separated by a newline character, and pipe (|) characters separate the fields in each record. Any optional field for which there is no meaningful data should contain a zero (0) as a placeholder.

The following is an example of a VSDir file:

..\..\Projects\csharp building blocks\BusinessFacade.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5015|10|#5022|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|127|0|Project
..\..\Projects\csharp building blocks\BusinessRules.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5016|20|#5023|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|128|0|Project
..\..\Projects\csharp building blocks\DataAccess.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5017|30|#5024|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|129|0|Project
..\..\Projects\csharp building blocks\SystemFrameworks.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5018|40|#5025|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|130|0|Project
..\..\Projects\csharp building blocks\WebService.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5019|50|#5026|{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}|4547|1|WebService|Web
..\..\Projects\csharp building blocks\WebUI.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5020|60|#5027|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|131|1|WebUI|web
..\..\Projects\csharp building blocks\WinUI.vsz|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|#5021|70|#5028|{AE77B8D0-6BDC-11d2-B354-0000F81F0C06}|132|0|Project

The following fields can be specified for each record in a VSDir file:

Field Meaning
RelPathName Required. The name of the Wizard's .vsz file, such as MyWizard.vsz.
{clsidPackage} Optional. A GUID representing a product (such as Visual C++) that has a DLL containing localized resources. Normally, this field is blank for VSDir files that correspond with third-party Wizards.
LocalizedName Optional. This is the localizable name of the Wizard or template and the name that appears in the Add Item dialog box. This can be a string or a resource identifier of the form #ResID.
SortPriority Required. An integer representing the sort order and relative priority of the Wizard, with 1 being highest. For instance, if this item is "1," then this will appear next to other 1s and ahead of all 2s or lower.
Description Required. A localizable description of the template or Wizard as it will appear in the Add Item dialog box when the item is selected. This can be a string or a resource identifier of the form #ResID. Applies only to template files, not folders.
DLLPath or {clsidPackage} Required. Specifies a full path to a DLL or EXE file, or a GUID of a product that has a .dll file that contains an icon to load for the Wizard. The icon is loaded as a resource out of a DLL/EXE file using the given IconResourceId. This setting overrides {clsidPackage}, if specified, for icon location. Applies only to template files, not folders.
IconResourceId Optional. A resource identifier within the DLL file that determines the icon to display. If no icon is defined, the environment substitutes the default icon for a file with the same extension as the item. Applies only to template files, not folders.
Flags Required. See Flags description and table below. Applies only to template files, not folders.
SuggestedBaseName Required. The default name for the Wizard, displayed in the Name field in the dialog box. This is either a string or a resource identifier of the form #ResID. If the name is not unique, the environment appends the name with an integer. For example, MyFile.asp might be changed to MyFile1.asp. If no name is provided, then "Project" is used. Applies only to template files, not folders.

Notes   

  • Any non-required field for which there is no meaningful data should contain a 0 (zero) as a placeholder.
  • If no localized name is provided, the relative path name is used.
  • If no icon is defined, the IDE substitutes the default icon for a file with that extension.
  • If no suggested base name is provided, "Project" is used.
  • Flags
    Required. Includes a group of bitwise flags used to enable or disable the Name and Location fields on the Add Item dialog box. That is, when the user selects Add New Item from the Add menu, the project determines whether the name and location are displayed in the Templates pane, but the flags determine if the name and location are available to the user.

    Set the value of Flags to the sum of the individual values. That is, 33 is equivalent to VSDIRFLAG_NonLocalTemplate | VSDIRITEM_DisableLocationField.

    Flag name Decimal value Description
    VSDIRFLAG_NonLocalTemplate 1 Use non-local user interface behavior and save mechanisms.
    VSDIRFLAG_BlankSolution 2 Create a blank (empty) solution; Do not create a project
    VSDIRFLAG_DisableBrowseButton 4 Disable the Browse button for this project or item.
    VSDIRFLAG_DontAddDefExtension 8 Do not append a default extension to the name provided for the item. (This setting is not valid for projects.)
    VSDIRFLAG_DisableLocationField 32 Disable the location field for this project or item.
    VSDIRFLAG_DontInitNameField 4096 Do not initialize the name field for this project or item with a valid name.
    VSDIRFLAG_DisableNameField 8192 Disable the name field for this project or item.

See Also

Walkthrough: Creating a New Enterprise Template | Creating Add-Ins and Wizards | Creating an Add-In | Creating a Wizard | Designing a Wizard | Visual Studio Commands | VSZ Files