# Community toolkit for VSCT files used in Visual Studio extensions
Part of the VSIX Community
A development time MSBuild extension to Microsoft.VSSDK.BuildTools
Adds a new item type VSCTInclude
which ensures that the items path is added to VSCTIncludePath
and gives a warning if you do not include it in any VSCTCompile
file.
It also contains the VSGlobals.vsct file originally from the ExtensibilityTemplatePack.
It means the file can be versioned, and updated after the project is created from the template.
It lights up via the VSCTIncludePath
item group used by the VSCTCompile
target/task.
This package attempts to solve some issues with the current extensibility model, specifically around VSCT files.
The most common symbols in VSCT files have unintelligable IDs based on the old complex COM nature. New symbols are available which alias these to more readable and discoverable names.
This is a living project where the whole community can contribute helpers on top of the official VS SDK. There is no need to wait for Microsoft to make an update, since this projet gives the ability to continue the work in a separate work stream.
For both project- and item templates that utilizes this NuGet packages, download the Extensibility Template Pack.
1) Remove any local copy of VSGlobals.vsct
you may have in your local project.
i) It may be hidden/nested under VSCommandTable.vsct
2) Install the package into your VSIX project
3)
i) If you started with a project created from the ExtensibilityTemplatePack using the VSIX Project w/Command (Community)
template, you don't need to do anything. :joy:
ii) If you used an older template, or a different template you can now include and use the globals.
Ensure you have the following in your VSCommandTable.vsct
file
<Include href="https://github.com/VsixCommunity/Community.VisualStudio.VSCT/blob/main/VSGlobals.vsct"/>
Replace items like
<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
with
<Parent guid="VSMainMenu" id="View.DevWindowsGroup.OtherWindows.Group1"/>
The top level groups are
If you have the latest ExtensibilityTemplatePack (V2.1.11 or higher) installed you will get intellisense and popups to show you where your item will be added. See Writing Visual Studio Extensions with Mads - Improving our community templates for a demonstration and more information.
If you set an item as VSCTInclude
, but then do not reference it from a VSCTCompile
item you will get two warnings.
<Include href="https://github.com/VsixCommunity/Community.VisualStudio.VSCT/blob/main/xxxx.vsct"/>
You can set these properties in your project or Directory.Build.props files.
Property | Default | Description |
---|---|---|
EnableDefaultVSCTIncludeItems |
true | Enable marking all non-VSCTCompile items of type *.vsct with the VSCTInclude Build Action. |
EnableVSGlobalsVSCT |
true | Add the VSGlobals.vsct file to the VSCTCompile tasks include search paths.Allows you to add |
Property | Default | Description |
---|---|---|
ShowVSGlobalsVSCT |
false | Show the VSGlobals.vsct file in your project. |
VSGlobalsVSCTDependentUpon |
VSCommandTable.vsct |
If ShowVSGlobalsVSCT is set to true, this is the name of the file under which the VSGlobals.vsct will be nested. |
VSGlobalsVSCTPath |
The directory of the package's copy of the VSGlobals.vsct |
This can be used to override the location with a personalized copy of the file, while keeping the logic from the package. |
VSCTIncludeExclude |
Semi-colon separated list of files (wildcards allowed) to exclude from being included as VSCTInclude if EnableDefaultVSCTIncludeItems is set to true. |