Visual Studio extensions help developers customize their development environment with additional tools, commands, templates, debugging features, and productivity improvements. However, maintaining an extension across multiple Visual Studio versions can become challenging when newer releases introduce APIs that are not available in earlier versions.
Traditionally, extension developers often maintained separate builds or restricted their extensions to specific Visual Studio versions. This created additional work for building, testing, publishing, and updating extensions.
Visual Studio 2026 introduces an updated extension compatibility model that makes this process easier. Starting with Visual Studio 2026 version 18.12, extension developers can build multiple SDK-targeted payloads and publish them under a single Visual Studio Marketplace entry.
Visual Studio automatically selects the most appropriate compatible payload when a developer installs or updates the extension.
This article explains how SDK-targeted extension payloads work, how to configure a multi-targeted VSIX project, how to publish multiple packages under one Marketplace entry, and how to manage compatibility across Visual Studio versions.
Understanding SDK-Targeted Extension Payloads
An extension payload is the packaged VSIX file that contains the extension binaries, metadata, and other required assets.
Different Visual Studio versions may support different API versions. When an extension needs newer APIs, a single binary may not be suitable for every supported Visual Studio installation.
SDK-targeted payloads solve this problem by allowing developers to produce separate extension packages for different Visual Studio API targets.
For example, consider an extension that supports Visual Studio 2022 and Visual Studio 2026.
The extension developer wants to introduce a new feature that uses APIs available in Visual Studio 2026 version 18.12. However, users running Visual Studio 2022 should continue using the extension without losing existing functionality.
The developer can produce two payloads:
A Visual Studio 17.14 payload that supports the earlier API version.
A Visual Studio 18.12 payload that uses the newer APIs.
Both packages belong to the same Marketplace extension entry. Users do not need to search for separate editions or manually select a package during installation.
What Changed in Visual Studio 2026?
Visual Studio 2026 introduced an API-version-based compatibility model. This reduces the need to update extension compatibility declarations every time a new major Visual Studio release becomes available.
Previously, extension developers commonly declared compatibility through Visual Studio product version ranges in the VSIX manifest. The compatibility model now evaluates supported API versions.
For extensions built against supported APIs, Visual Studio 2022 extensions can continue working in Visual Studio 2026 without requiring a separate build.
Visual Studio 2026 version 18.12 adds another important capability: developers can publish multiple SDK-targeted payloads under one Marketplace entry.
The updated model provides three important capabilities.
Multi-targeted builds
Developers can declare multiple Visual Studio SDK targets in a single project file. The build tooling generates a separate payload for each target.
Multiple payloads in Marketplace
The Marketplace allows extension authors to upload and manage multiple VSIX packages under one extension listing.
Automatic payload selection
Visual Studio selects the compatible package based on the installed IDE's API version, edition, and architecture.
This approach allows extension developers to introduce new functionality without immediately dropping support for earlier Visual Studio installations.
Understanding the SDK and API Version Targets
Visual Studio SDK targets represent the API versions that an extension is built to use.
For example, the following targets represent two different Visual Studio API generations:
SDK target | Compatibility purpose |
|---|---|
vs17_14 | Supports Visual Studio 2022 version 17.14 |
vs18_12 | Supports Visual Studio 2026 version 18.12 and compatible later API versions |
The important difference is that the extension version and Visual Studio API version are separate concepts.
The extension version identifies a release of your extension, such as 1.0.0 or 1.0.1.
The API target identifies the minimum Visual Studio API version required by a particular payload.
A developer can publish extension version 1.0.0 for both API targets because they are separate Marketplace package targets.
Creating a Multi-Targeted VSIX Project
Visual Studio provides the Modern VSIX Project template for creating extension projects with the updated SDK-style build system.
The template supports VSSDK extensions, VisualStudio.Extensibility extensions, and hybrid extensions.
To create a project:
Open Visual Studio 2026.
Select File and then New Project.
Search for Modern VSIX Project.
Enter the project name and location.
Select the target Visual Studio version.
Choose the extension type.
Keep the top-level Visual Studio SDK option selected if you want to use the modern project SDK.
Configure the publisher information and create the project.
The template requires Visual Studio 18.11 or later with the Visual Studio SDK installed.
The project can target Visual Studio 2022 version 17.14 or Visual Studio 2026. You can then modify the generated project file to support multiple targets.
Configuring Multiple SDK Targets in the Project File
The main configuration change is made in the project file.
For example, the following project targets both Visual Studio 2022 version 17.14 and Visual Studio 2026 version 18.12:
<Project Sdk="Microsoft.VisualStudio.Sdk.Build">
<PropertyGroup>
<TargetFrameworks>vs17_14;vs18_12</TargetFrameworks>
<ExtensionType>VisualStudio.Extensibility</ExtensionType>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>The TargetFrameworks property contains both SDK targets, separated by a semicolon.
The build tooling uses these targets to generate separate extension payloads.
The ExtensionType property identifies the extension model used by the project. In this example, the project uses VisualStudio.Extensibility.
The LangVersion property allows the project to use the latest supported C# language features available in the build environment.
The important point is that developers do not need to maintain two completely separate project files for these targets.
The same project can produce multiple payloads while allowing each target to use the APIs available in its corresponding SDK.
Using Different APIs for Different Visual Studio Versions
One of the biggest advantages of multi-targeted extension builds is that developers can use newer APIs without removing support for earlier Visual Studio installations.
For example, imagine an extension that provides a custom developer tool window.
The earlier version of the extension uses APIs supported by Visual Studio 2022. A newer implementation uses an API introduced in Visual Studio 2026 version 18.12.
The project can conditionally compile code based on the target framework.
public class ExtensionFeature
{
public string GetFeatureName()
{
#if VS18_12
return "New Visual Studio Feature";
#else
return "Compatible Visual Studio Feature";
#endif
}
}The example illustrates the general idea of conditional compilation. However, the actual conditional symbols must be defined by the project or build configuration. Do not assume that VS18_12 is automatically defined by the SDK.
You can define target-specific constants in the project file:
<PropertyGroup Condition="'$(TargetFramework)' == 'vs18_12'">
<DefineConstants>$(DefineConstants);VS18_12</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'vs17_14'">
<DefineConstants>$(DefineConstants);VS17_14</DefineConstants>
</PropertyGroup>Now the extension can compile different implementations for the two targets.
This is useful when an extension needs to adopt newer APIs gradually while preserving an earlier implementation for existing users.
For larger extensions, consider separating version-specific functionality into dedicated classes or projects. This keeps conditional compilation from spreading throughout the entire codebase.
Building Multiple Extension Payloads
After configuring the project, build the extension using the normal .NET build process:
dotnet buildThe SDK build tooling processes the declared target frameworks and generates a payload for each target.
For example, the project can produce separate packages for the 17.14 and 18.12 SDK targets.
The exact output directory and package names depend on the project and build configuration.
Before publishing, inspect the generated VSIX packages. Verify the extension ID, extension version, installation targets, architecture, and generated SDK metadata.
Do not assume that a successful build automatically means every payload is ready for Marketplace publishing.
Each package should be installed and tested against its intended Visual Studio configuration.
Understanding Payload Compatibility Metadata
Every payload contains compatibility information that Visual Studio and Marketplace use to determine where the package can be installed.
Important metadata includes:
VSIX ID.
Extension version.
Minimum supported API version.
Visual Studio edition.
Processor architecture.
Required SDK metadata and prerequisites.
The VSIX ID must remain the same across all payloads belonging to the same extension.
Join the conversation! Your thoughts help the community grow.