Skip to content

Commit 9fbc996

Browse files
authored
feat(sdk): support NuGet Central Package Management (#43)
Remove implicit PackageReference for Microsoft.VSSDK.BuildTools from the SDK. This allows projects using NuGet Central Package Management (CPM) to work correctly, as CPM requires PackageReference items to not have a Version attribute when versions are centrally managed. Users must now explicitly add the PackageReference in their project: <PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" /> This is a breaking change but aligns with CPM compatibility requirements. Closes #27
1 parent 48da9ae commit 9fbc996

18 files changed

Lines changed: 23 additions & 14 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Replace your entire `.csproj` file with the SDK-style format:
104104

105105
<ItemGroup>
106106
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
107+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
107108
</ItemGroup>
108109
</Project>
109110
```
@@ -135,12 +136,11 @@ Convert from `packages.config` to `PackageReference` format in your `.csproj`:
135136
```xml
136137
<ItemGroup>
137138
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
139+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
138140
<!-- Add other packages your extension uses -->
139141
</ItemGroup>
140142
```
141143

142-
> **Note:** `Microsoft.VSSDK.BuildTools` is automatically included by the SDK.
143-
144144
#### Step 6: Handle VSCT Files
145145

146146
If you have `.vsct` files, they're automatically included. Remove any explicit `<VSCTCompile>` items unless you need custom metadata.
@@ -179,6 +179,7 @@ If you prefer to set up manually, create a `.csproj` file:
179179

180180
<ItemGroup>
181181
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
182+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
182183
</ItemGroup>
183184
</Project>
184185
```

samples/SampleExtension/SampleExtension.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
19+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1920
</ItemGroup>
2021

2122
</Project>

src/CodingWithCalvin.VsixSdk/Sdk/Sdk.Vsix.props

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@
1717
Condition="Exists('$(MSBuildThisFileDirectory)..\analyzers\dotnet\cs\CodingWithCalvin.VsixSdk.Generators.dll')" />
1818
</ItemGroup>
1919

20-
<!--
21-
Implicit package references for VSIX development.
22-
Users can override the version by setting VssdkBuildToolsVersion before SDK import.
23-
-->
24-
<PropertyGroup>
25-
<VssdkBuildToolsVersion Condition="'$(VssdkBuildToolsVersion)' == ''">17.*</VssdkBuildToolsVersion>
26-
</PropertyGroup>
27-
28-
<ItemGroup>
29-
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="$(VssdkBuildToolsVersion)" PrivateAssets="all" />
30-
</ItemGroup>
31-
3220
<PropertyGroup>
3321
<!-- Identify that this SDK is in use -->
3422
<UsingCodingWithCalvinVsixSdk>true</UsingCodingWithCalvinVsixSdk>

tests/e2e/E2E.AllFeatures/E2E.AllFeatures.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
19+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1920
</ItemGroup>
2021

2122
<!-- Manual template with subpath -->

tests/e2e/E2E.AutoIncludes/E2E.AutoIncludes.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
18+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1819
</ItemGroup>
1920

2021
</Project>

tests/e2e/E2E.CustomPkgDef/E2E.CustomPkgDef.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
17+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1718
</ItemGroup>
1819

1920
<!-- Include custom pkgdef files to merge with auto-generated -->

tests/e2e/E2E.ImageAndContentManifest/E2E.ImageAndContentManifest.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<ItemGroup>
1616
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
17+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1718
</ItemGroup>
1819

1920
</Project>

tests/e2e/E2E.ManualPkgDef/E2E.ManualPkgDef.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
19+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1920
</ItemGroup>
2021

2122
<!-- Use manual pkgdef file -->

tests/e2e/E2E.Minimal/E2E.Minimal.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
18+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1819
</ItemGroup>
1920

2021
</Project>

tests/e2e/E2E.SourceGenerators/E2E.SourceGenerators.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<ItemGroup>
1818
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.*" />
19+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.*" PrivateAssets="all" />
1920
</ItemGroup>
2021

2122
<!-- Include assets referenced in manifest -->

0 commit comments

Comments
 (0)