Community.VisualStudio.VSCT 16.0.22

There is a newer version of this package available.
See the version list below for details.
dotnet add package Community.VisualStudio.VSCT --version 16.0.22                
NuGet\Install-Package Community.VisualStudio.VSCT -Version 16.0.22                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Community.VisualStudio.VSCT" Version="16.0.22">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Community.VisualStudio.VSCT --version 16.0.22                
#r "nuget: Community.VisualStudio.VSCT, 16.0.22"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Community.VisualStudio.VSCT as a Cake Addin
#addin nuget:?package=Community.VisualStudio.VSCT&version=16.0.22

// Install Community.VisualStudio.VSCT as a Cake Tool
#tool nuget:?package=Community.VisualStudio.VSCT&version=16.0.22                

Community toolkit for VSCT files used in Visual Studio extensions

Part of the VSIX Community

NuGet

Summary

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.

Purpose

This package attempts to solve some issues with the current extensibility model, specifically around VSCT files.

The API is dated and has lots of ugly COM legacy noise

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.

Only Microsoft can update the build tools and that doesn't scale

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.

Templates

For both project- and item templates that utilizes this NuGet packages, download the Extensibility Template Pack.

How to use

VSGlobals

  1. Remove any local copy of VSGlobals.vsct you may have in your local project.
    1. It may be hidden/nested under VSCommandTable.vsct
  2. Install the package into your VSIX project
    1. 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. 😂
    2. 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="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

  • VSMainMenu
  • VSNuGet
  • VSTerminal
  • VSFeedback
  • VSEditor
  • VSEditor2

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.

Warnings

If you set an item as VSCTInclude, but then do not reference it from a VSCTCompile item you will get two warnings.

  • CVSTK001 No VSCTCompile file includes this VSCTInclude
    • This is shown for each VSCTInclude and jumps you to the include file.
  • CSVTK002 Add <Include href="xxxx.vsct"/>
    • This is shown for each VSCTCompile and jumps you to the compile file
    • xxxx.vsct is the name of the VSCTInclude file.
    • Here you can add the relevant snippet
  <Include href="xxxx.vsct"/>

Properties

You can set these properties in your project or Directory.Build.props files.

Simple

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.<br/>Allows you to add <pre lang="xml"> <code><Include href="VSGlobals.vsct"/></code></pre>

Advanced

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.
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (9)

Showing the top 5 popular GitHub repositories that depend on Community.VisualStudio.VSCT:

Repository Stars
VsixCommunity/Community.VisualStudio.Toolkit
Making it easier to write Visual Studio extensions
jeffdapaz/VisualChatGPTStudio
Add chatGPT functionalities directly on Visual Studio
madskristensen/MarkdownEditor2022
A Visual Studio extension
kitamstudios/rust-analyzer.vs
Rust language support for Visual Studio 2022
Exafunction/CodeiumVisualStudio
Visual Studio extension for Codeium
Version Downloads Last updated
16.0.29.6 54,862 4/18/2021
16.0.29.5 372 4/18/2021
16.0.29 405 4/12/2021
16.0.27 352 4/12/2021
16.0.22 460 4/12/2021