Skip to content

Remove dead PackageReferences from the C++ VSIX extension project - #6741

Merged
Kyaw Thant (kythant) merged 1 commit into
release/dev/monobuildfrom
user/kythant/remove-dead-vsix-packagerefs
Sep 9, 2026
Merged

Remove dead PackageReferences from the C++ VSIX extension project#6741
Kyaw Thant (kythant) merged 1 commit into
release/dev/monobuildfrom
user/kythant/remove-dead-vsix-packagerefs

Conversation

@kythant

Copy link
Copy Markdown
Contributor

Removes four PackageReference entries from the C++ Dev17 VSIX extension project that produce nothing, and the CPM entries that only existed to version one of them.

What is dead about them

All four were declared as:

<PackageReference Include="..." GeneratePathProperty="true">
  <ExcludeAssets>All</ExcludeAssets>
</PackageReference>

ExcludeAssets=All flows no compile, runtime, build, native, contentfiles or analyzer assets. The only thing such a reference can contribute is the $(Pkg<Id>) path property that GeneratePathProperty="true" creates. None of the four properties is referenced anywhere in the repository:

Path property Uses (case-insensitive, repo-wide)
PkgMicrosoft_WindowsAppSDK 0
PkgMicrosoft_Windows_CppWinRT 0
PkgMicrosoft_Windows_SDK_BuildTools 0
PkgMicrosoft_Windows_ImplementationLibrary 0

For contrast, the one path property this project does use is PkgNuget_VisualStudio, consumed two lines below by the ExtensionDependencies item that pulls NuGet.VisualStudio.dll into the VSIX. That reference is untouched.

So the four cost a package download on every build and contribute nothing to the produced .vsix.

Why the WindowsAppSDK one matters more than the others

It is a self-reference, and it was pinned to the public 1.6.250408002 metapackage — an April 2025 release. It was declared in Directory.Packages.props under "External Package Versions", next to WebView2 and TAEF, as a bare literal:

<MicrosoftWindowsAppSDKVersion>1.6.250408002</MicrosoftWindowsAppSDKVersion>

Note it was not in the IsInternal="true" "WindowsAppSDK Packages" group and not expressed via the $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', ...)) pattern the internal packages use. Nothing could ever update it, by construction.

The visible symptom: the Windows App SDK mono-build's CreateVSIX stage downloads a 1.6 metapackage on every run while building 2.x bits —

Installed Microsoft.WindowsAppSDK 1.6.250408002 from https://microsoft.pkgs.visualstudio.com/ProjectReunion/...

Nothing consumed it, so no 1.6 content ever entered the shipping .vsix, but it is confusing to anyone auditing where package versions come from, and it is a stale public dependency recorded against a shipping component.

Removing the reference orphans its CPM entries, so this also drops the Self-Reference ItemGroup and the MicrosoftWindowsAppSDKVersion property.

Deliberately not touched

  • MicrosoftWindowsAppSDKVersionPackageVersion (1.8.0, line 32). Confusingly similar name, completely different purpose — BuildAll.ps1 reads it for pipeline version metadata. Left alone.
  • test/ABForward and test/TestApps/StoragePickersTestApp. These pin 1.6.250408002 through packages.config, which does not resolve through Central Package Management, so the compat-test self-reference the deleted ItemGroup comment referred to is unaffected by this change.
  • dev/Templates/Source/ProjectTemplates/**/ProjectTemplate.csproj. Template payload, versioned by the $WindowsAppSdkVersion$ token that gets substituted at template instantiation. Never restored by this build — they carry an explicit Version=, which would be an NU1008 error under CPM if they were.
  • The same dead Microsoft.Windows.SDK.BuildTools pattern in the sibling WindowsAppSDK.Cs.Extension.Dev17.csproj. Same analysis applies, but it is not part of the issue that prompted this, so it is left for a separate change.

Validation

Windows App SDK mono-build nightly (def 190463), CreateVSIX stage only, with the Foundation repo resource overridden to this branch and everything else reused from a known-good full run:

  • useBuildOutput_RebuildStage=CreateVSIX, useBuildOutput_BuildId=156949558
  • resources.repositories.WindowsAppSDKFoundation.refName = this branch, resolved at 5027d617

Build: https://dev.azure.com/microsoft/OS/_build/results?buildId=157025355&view=results

Checking that restore still succeeds without the four references, all four .vsix files still build and sign, and 1.6.250408002 no longer appears in the logs. Result posted below.

The Cpp Dev17 VSIX project carried four PackageReferences declared as
`GeneratePathProperty="true"` with `<ExcludeAssets>All</ExcludeAssets>`. That
combination flows no compile/runtime/build assets, so the only thing such a
reference produces is its `$(Pkg<Id>)` path property. None of the four
properties is referenced anywhere in the repo:

  PkgMicrosoft_WindowsAppSDK                 0 uses
  PkgMicrosoft_Windows_CppWinRT              0 uses
  PkgMicrosoft_Windows_SDK_BuildTools        0 uses
  PkgMicrosoft_Windows_ImplementationLibrary 0 uses

(The only Pkg* property actually consumed under dev/Templates is
PkgNuget_VisualStudio, for the NuGet.VisualStudio.dll ExtensionDependencies
item.) So all four only cost a package download per build and contribute
nothing to the produced .vsix.

The Microsoft.WindowsAppSDK one also made the mono-build's CreateVSIX stage
download the public 1.6.250408002 metapackage - an April 2025 release - on every
run of a stage that is otherwise building 2.x bits. It was declared in
Directory.Packages.props under "External Package Versions" as a bare literal,
not via the WindowsAppSDKVersionPinned pattern the internal packages use, so
nothing could ever update it.

Removing that reference orphans the corresponding CPM entries, so drop them too:
the "Self-Reference" ItemGroup and the MicrosoftWindowsAppSDKVersion property.

Deliberately NOT touched:
  * MicrosoftWindowsAppSDKVersionPackageVersion (1.8.0) - a different, similarly
    named property that BuildAll.ps1 reads for pipeline version metadata.
  * test/ABForward and test/TestApps/StoragePickersTestApp - they pin
    1.6.250408002 through packages.config, which does not go through CPM, so
    the compat-test self-reference those exist for is unaffected.
  * The dev/Templates/Source/ProjectTemplates ProjectTemplate.csproj files -
    template payload, versioned by the $WindowsAppSdkVersion$ token, never
    restored by this build.
  * The same dead Microsoft.Windows.SDK.BuildTools pattern in the sibling
    Cs Dev17 project - left for a separate change.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@kythant
Kyaw Thant (kythant) marked this pull request as ready for review September 8, 2026 22:54
@kythant

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@kythant

Copy link
Copy Markdown
Contributor Author

Validation: build 157025355succeeded

CreateVSIX stage only, Foundation resource pinned to this branch at 5027d617, everything else reused from full run 156949558.

Restore and build are unaffected by the removal:

Restore WindowsAppSDK.Extension.sln             => succeeded
Build Standalone WindowsAppSDK.Extension.sln    => succeeded
Restore Component WindowsAppSDK.Extension.sln   => succeeded
Build Component WindowsAppSDK.Extension.sln     => succeeded
CodeSign repacked package (VSIX) x4             => succeeded
Check build artifacts exist                     => succeeded

All four .vsix files still build and sign.

The stale restore is gone. Baseline run 156949558 had:

Installed Microsoft.WindowsAppSDK 1.6.250408002 from https://microsoft.pkgs.visualstudio.com/ProjectReunion/...

That line no longer appears. Scanning every task log for installs of the four formerly-referenced packages, the only remaining one is:

Installed Microsoft.Windows.SDK.BuildTools 10.0.26100.4654 from https://microsoft.pkgs.visualstudio.com/...

which comes from the sibling WindowsAppSDK.Cs.Extension.Dev17.csproj — it carries the same dead GeneratePathProperty + ExcludeAssets=All pattern for Microsoft.Windows.SDK.BuildTools, deliberately left out of this PR and called out in the description as a separate change.

Remaining mentions of 1.6.250408002 — 2 lines, both expected:

[Component Governance Detection] Microsoft.WindowsAppSDK 1.6.250408002 - NuGet
[Component Governance]           Microsoft.WindowsAppSDK 1.6.250408002 - NuGet

Component Governance scans source manifests, not just what the build restores, so it still picks the version up from test/ABForward/packages.config and test/TestApps/StoragePickersTestApp/packages.config. Those are the compat-test pins this PR deliberately leaves alone — they resolve through packages.config, not CPM, so they are unaffected by removing the PackageVersion entry.

Worth noting explicitly: CG detecting it is the honest signal. The 1.6 self-reference is genuinely still a declared dependency of the repo via those two test apps; this PR only stops the VSIX build from restoring it for no reason. If we want it gone from CG as well, retiring or re-pinning those two compat tests is the follow-up.

@kythant
Kyaw Thant (kythant) enabled auto-merge (squash) September 9, 2026 00:47
@kythant
Kyaw Thant (kythant) merged commit 924cfdd into release/dev/monobuild Sep 9, 2026
51 checks passed
@kythant
Kyaw Thant (kythant) deleted the user/kythant/remove-dead-vsix-packagerefs branch September 9, 2026 01:21
@kythant

Copy link
Copy Markdown
Contributor Author

Ported to release/dev/monobuild-2.0-stable as #6742 (draft).

Applied natively rather than cherry-picked: the VSIX project sits at dev/VSIX/Extension/Cpp/Dev17/ on that branch versus dev/Templates/VSIX/Extension/Cpp/Dev17/ here. File contents are byte-identical, so the port's diff matches this one exactly (0/12 and 0/6), and all four Pkg* path properties are likewise unused there while PkgNuget_VisualStudio has 2 uses.

That branch's Directory.Packages.props has its own fallback literals (Base 2.0.4, FrameworkUdk 2.0.0-stable-27200.1029.260616-0840.3, ...), none of which were touched.

If this PR takes review-feedback commits, #6742 needs re-diffing before either completes.

@kythant

Copy link
Copy Markdown
Contributor Author

Post-merge validation: build 157038503succeeded

Closing the gap I flagged earlier: the pre-merge validation only exercised CreateVSIX, but Directory.Packages.props is a repo-wide CPM file, and the Foundation and CreateInstaller stages also build from this repo. This run covers the Foundation stage against the merged commit 924cfdd6.

useBuildOutput_RebuildStage=Foundation, useBuildOutput_BuildId=156949558, Foundation repo resolved at 924cfdd6a9.

All jobs green — 4 Foundation arches + 4 MRT arches + AnyCPU + Pack:

Build Foundation (x64 / x86 / arm64 / arm64ec / AnyCPU)  => succeeded
Build MRT        (x64 / x86 / arm64 / arm64ec)           => succeeded
Pack Foundation NuGet                                     => succeeded

The removed CPM entry stranded nothing. Across 1035 task logs:

Check Count
Failed tasks 0
NU1010 / NU1008 0
Unable to find version 0

NU1010 is the specific error a removed PackageVersion would cause if any project still had a versionless PackageReference to the metapackage. Zero occurrences confirms the static analysis in the PR description: after this change no such reference exists.

Version resolution is coherentGenerate packages.config from CPM in Foundation x64:

Microsoft.WindowsAppSDK.Base = 2.0.1-dev.experimental1Y
Microsoft.FrameworkUdk = 2.0.1-dev.experimental1Y
Microsoft.ProjectReunion.InteractiveExperiences.TransportPackage = 2.0.1-dev.experimental1Y
Microsoft.WindowsAppSDK.InteractiveExperiences = 2.0.1-dev.experimental1Y
Microsoft.WindowsAppSDK.AppLicensingInternal.TransportPackage = 2.0.1-dev.experimental1Y

Note on the earlier failed attempt

My first attempt at this (157035704) failed, and it was my stage selection, not this change. I used BasePackage,Foundation; rebuilding BasePackage produces a Base nupkg stamped with the new run's version while AppLicensing / IXP still come from the reference build at the old version. Foundation's Auto-detect version from artifacts probes Base first, pinned the new version, and CPM then demanded it for packages that only existed locally at the old one:

Unable to find version '2.0.1-dev.experimental2F' of package
  'Microsoft.WindowsAppSDK.AppLicensingInternal.TransportPackage'

That run also had 0 NU1010/NU1008, and the failing packages were internal ones this PR never touched — so it never implicated the change. Rebuilding Foundation alone keeps all three upstream artifacts on one coherent version, which is what this run shows.

Remaining coverage note: CreateInstaller also consumes this CPM file. It was exercised against the pre-merge branch by the mono-build work in 16748094; the next full nightly will cover it against merged Foundation end to end.

Kyaw Thant (kythant) added a commit that referenced this pull request Sep 9, 2026
)

Port of PR #6741 to release/dev/monobuild-2.0-stable.

Applied natively rather than cherry-picked because the VSIX project lives at a
different path on this branch: dev/VSIX/Extension/Cpp/Dev17/ here versus
dev/Templates/VSIX/Extension/Cpp/Dev17/ on release/dev/monobuild. The file
contents are byte-identical, so the resulting diff matches the source PR exactly:
0 insertions / 12 deletions in the csproj and 0 / 6 in Directory.Packages.props.

The defect is present on this branch identically. The Cpp Dev17 VSIX project
carried four PackageReferences declared GeneratePathProperty="true" with
<ExcludeAssets>All</ExcludeAssets>. That combination flows no assets, so the only
thing such a reference produces is its $(Pkg<Id>) path property, and none of the
four is referenced anywhere on this branch:

  PkgMicrosoft_WindowsAppSDK                 0 uses
  PkgMicrosoft_Windows_CppWinRT              0 uses
  PkgMicrosoft_Windows_SDK_BuildTools        0 uses
  PkgMicrosoft_Windows_ImplementationLibrary 0 uses
  PkgNuget_VisualStudio                      2 uses  <- the one that IS used, kept

The Microsoft.WindowsAppSDK one pinned the public 1.6.250408002 metapackage, an
April 2025 release, declared as a bare literal under "External Package Versions"
rather than through the WindowsAppSDKVersionPinned pattern the internal packages
use, so nothing could ever update it. Removing the reference orphans its CPM
entries, so the Self-Reference ItemGroup and the MicrosoftWindowsAppSDKVersion
property go too. After the change no PackageReference to the metapackage remains
anywhere in the repo, so the CPM entry cannot be needed.

Deliberately NOT touched:
  * MicrosoftWindowsAppSDKVersionPackageVersion (1.8.0) - a different, similarly
    named property that BuildAll.ps1 reads for pipeline version metadata.
  * test/ABForward/packages.config, which pins 1.6.250408002 through
    packages.config. That does not resolve via Central Package Management, so the
    compat-test self-reference the deleted ItemGroup comment referred to is
    unaffected. (This branch has only that one such test; release/dev/monobuild
    also has test/TestApps/StoragePickersTestApp.)
  * The same dead Microsoft.Windows.SDK.BuildTools pattern in the sibling
    Cs Dev17 project - left for a separate change, as on the source PR.

This branch's Directory.Packages.props legitimately diverges from
release/dev/monobuild in its fallback literals (Base 2.0.4, FrameworkUdk
2.0.0-stable-27200.1029.260616-0840.3, and so on). None of those were touched -
only the two orphaned self-reference entries were removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants