Skip to content

fix(sdk): add support for NuGet Central Package Management #27

@CalvinAllen

Description

@CalvinAllen

Problem

The SDK currently adds an implicit PackageReference for Microsoft.VSSDK.BuildTools with a hardcoded version:

<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="$(VssdkBuildToolsVersion)" PrivateAssets="all" />

This breaks projects using NuGet Central Package Management (CPM) because CPM requires that PackageReference items do NOT have Version attributes - versions must be defined centrally in Directory.Packages.props.

Proposed Solution

Remove the implicit PackageReference from the SDK entirely. Users will explicitly add the dependency themselves:

<PackageReference Include="Microsoft.VSSDK.BuildTools" PrivateAssets="all" />

Rationale

  • The SDK's role is to provide MSBuild integration (props/targets), not manage package references
  • Explicit dependencies are clearer and more maintainable
  • Works naturally with CPM - users define the version in Directory.Packages.props
  • Works with non-CPM - users specify the version directly on the PackageReference

Changes Required

  1. Remove from Sdk.Vsix.props:

    • Remove the VssdkBuildToolsVersion property (lines 21-23)
    • Remove the PackageReference for Microsoft.VSSDK.BuildTools (lines 25-27)
  2. Update template (src/CodingWithCalvin.VsixSdk.Templates/templates/vsix-extension/VsixExtension.csproj):

    • Ensure template includes the PackageReference explicitly (already does)
  3. Update documentation:

    • Document that users must add Microsoft.VSSDK.BuildTools package reference
    • Add migration guide for existing users

Breaking Change

This is a breaking change for existing users who rely on the implicit package reference. They will need to add the PackageReference explicitly after upgrading.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions