NuGet Package Manager for Visual Studio CodeA full-featured NuGet package manager for Visual Studio Code — browse, install, update, and audit packages across all your .NET projects without leaving the editor.
Table of Contents
Features
Requirements
InstallationFrom the Marketplace (recommended)
Or install directly from the command line:
From a .vsix fileDownload the latest
Or via the Extensions panel: click ··· → Install from VSIX… Getting Started
Tabs and WorkflowsBrowse
Search nuget.org (or any configured feed) and install packages into your projects.
InstalledShows every package installed across all selected projects. Select a package to open its details:
Updates
Lists all packages where a newer version is available on the configured sources.
Consolidate
Detects packages that are installed at different versions across your projects.
Vulnerabilities
Scans installed packages against the NuGet vulnerability database, including dependencies.
CleanupFinds Transitive duplicates are computed per target framework from
Opening Cleanup restores any project whose The Cleanup tab badge counts both kinds of cleanup: unused
Use Remove unused after reviewing the list. This replaces the PowerShell Toolchain
The last tab reports the .NET SDK the extension will actually use, and lets you change it without leaving the editor.
The same selector is available in Settings → dotnet toolchain and in a warning banner that appears above the package list whenever the toolchain cannot serve a restore. Activity Bar and Background Checks
Project TreeThe collapsible project tree on the left of the main view lets you scope operations:
CommandsAccess these from the Command Palette (
ConfigurationOpen VS Code Settings (
Example
|
| Situation | Behaviour |
|---|---|
Version="1.0.$(Minor)" — a property embedded in other text |
literal version on that PackageVersion |
A conditional <FooBarVersion Condition="..."> |
literal version |
| More than one definition of the property | literal version |
| The defining file is outside the workspace | literal version |
| Projects sharing the props file resolve the property differently | literal version |
Every file the update will touch — including the property file — is snapshotted before the first write, and a failed restore rolls it back with the rest of the transaction. Evaluations are cached per project and target framework and invalidated after a CPM write, so the next refresh sees the new value.
Because the tabs and the write path use the same evaluation, this works with the existing multi-framework rows, transactional batch updates, Consolidate and Cleanup without a separate code path.
Inline Version Decorations
Enable nugetpackagemanager.enablePackageVersionInlineInfo to see available updates directly in your project files:
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> ← 13.0.3 available
Decorations appear in the gutter next to <PackageReference> entries whenever a newer version exists on your configured sources. They are informational.
Troubleshooting: SDK and Workload Errors
The extension runs dotnet in the directory that owns the project's nearest global.json, because that is where the dotnet host selects its SDK from. A project pinning 10.0.403 therefore restores with 10.0.403 even if a newer SDK is installed.
When something in the toolchain is wrong, the extension says so instead of showing raw MSBuild output:
A banner above the package list appears when the selected SDK does not satisfy the
global.jsonpin, the pinned SDK is missing, or a realdotnet msbuild -getPropertyevaluation fails.When a selection cannot be applied, the preflight computes a change plan and shows it in one dialog:
Ordered steps — every change is grouped into
Step 1,Step 2, … by dependency depth, so a set that cannot go in at once can be applied across sessions: step 1 never needs anything a later step installs.Direct references to update — rows the Updates tab already knows, each at the exact version the conflict asks for.
Directory.Packages.propschanges — raised centrally in one write (then one restore) when every target framework agrees on the version.Needs conditional
<PackageVersion>groups — when the preview set requires different versions per TFM (Microsoft.AspNetCore.Identity.EntityFrameworkCoreis10.0.14fornet10.0but11.0.0-rc.3…fornet11.0), a single unconditional version cannot satisfy both, so nothing is written and the dialog names each TFM and version.Requirements without a resolvable version — listed so they can be pinned by hand.
If the plan contains conditional or unresolved items, the update stops before writing anything. Otherwise it applies the central raises, includes the direct updates and re-runs the preflight. Requirements come from the package's dependency group for each project's target framework, and the check follows the closure: if a raised sibling itself requires a newer package, that requirement is part of the plan too (bounded to 250 inspected packages). The conclusion therefore matches what dotnet restore would enforce, not just the first level.
This is the normal shape of a coordinated preview release: the new package versions require their siblings at the same preview version, and Central Package Management still pins the previous one.
A failed update or restore shows the cause, a suggested fix, and a collapsed Show output section with the raw diagnostics. A promoted vulnerability audit (NU1900–NU1905 in WarningsAsErrors) is reported as such — with the affected packages, severity and an Open advisory action — instead of being described as a version conflict.
- Version conflicts (
NU1107,NU1605,NU1608) carry their dependency chains and a Pin<Package>to<version>action: the suggested version is written to theDirectory.Packages.propsgroup (CPM) or the project'sPackageReference, then restored through the same job, with the outcome reported in the card. - Copy diagnostics (in the banner, in the error card, and in Settings → dotnet toolchain) copies a redacted report: selected SDK, pin, nearest
global.json, per-project working directory,dotnet --list-sdksanddotnet --info. The same report is written to the NuGet Package Manager for Visual Studio Code output channel, and is available from the Command Palette as Copy dotnet Toolchain Diagnostics.
The most common case is a workload manifest conflict, which looks like this:
error MSB4242: SDK Resolver Failure: ... WorkloadManifestCompositionException:
Workload pack 'Microsoft.NET.Runtime.Emscripten.Node.net10' in manifest
'microsoft.net.workload.emscripten.net10' conflicts with manifest
'microsoft.net.workload.emscripten.current'
That is a machine-level SDK problem, not a package problem: two installed manifests declare the same workload pack at different versions, so every SDK resolution fails before restore starts.
The Toolchain tab offers Update workloads and Repair workloads for this issue, which run dotnet workload update / dotnet workload repair for the selected SDK and show the raw output. On MSI-based .NET installs these commands usually need an elevated terminal; the extension says so when it detects an access-denied failure.
If the conflict mentions a band you no longer have installed, the hint names the left-over folder and the tab lists it under left-over manifest bands (no installed SDK). sdk-manifests\<band> entries are not removed when an SDK is uninstalled, and neither workload update nor repair cleans them up — a newer SDK still composes them, which is enough to break every restore. Copy cleanup command puts an elevated Rename-Item (rename, not delete, so it is reversible) on the clipboard; run it, then press Re-check.
Only stable band folders (10.0.100, 9.0.100, …) are reported. Prerelease bands such as 11.0.100-rc.2 are routinely installed by Visual Studio and referenced by active workloads, so they are deliberately left out of the list.
Choosing a different SDK
The Toolchain tab, the toolchain banner and Settings → dotnet toolchain show an SDK selector listing every SDK found by dotnet --list-sdks plus any SDK the extension installed itself.
Picking a version writes it into the workspace's global.json — the file dotnet itself reads — so the pin is versioned with the repository instead of living in settings.json. The edit is surgical (comments, key order and unrelated sections survive) and keeps the rest of the file consistent with the pin:
sdk.versionis the exact installed SDK, andsdk.rollForwardis set todisableso the build uses that SDK rather than a newer patch.sdk.allowPrereleaseis set totruewhen the chosen SDK is a prerelease (otherwise the pin can never resolve).sdk.workloadVersionis removed when it pins a workload set for a different feature band — a10.0.400workload set under an11.0.100SDK is inconsistent by construction.tools.dotnetis kept in step with the pinned SDK.
When the workspace has no global.json, it is created with Microsoft's template (dotnet new globaljson --sdk-version <v> --roll-forward disable); an existing file is never handed to the template, since that would drop sections such as tools and test.
Installing the pinned SDK
When global.json pins an SDK that is not installed, the selector offers Install <version>. After you confirm, the extension downloads Microsoft's official dotnet-install script (https://dot.net/v1/dotnet-install.<ps1|sh>), installs that SDK under your user profile (~/.dotnet), pins it in global.json, and re-runs the health check. The action requires a trusted workspace and is the only place the extension executes downloaded code; credentials in the session are never sent with it.
Contributing
Contributions are welcome — bug reports, feature requests, documentation improvements, and pull requests.
Reporting Issues
Please use the GitHub Issues tracker. Include:
- VS Code version
- Extension version
- Steps to reproduce
- Relevant output from the NuGet Package Manager for Visual Studio Code output channel (set
logLeveltoDEBUG)
Development Setup
Prerequisites: Node.js 19+, npm, and .NET SDK 8+ (the NugetPackageManager.Core* projects target net8.0)
# 1. Clone the repository
git clone https://github.com/I-Synergy/NugetPackageManager.git
cd NugetPackageManager
# 2. Install dependencies
npm install
# 3. Build the extension bundles
npm run esbuild
# 4. Publish the .NET sidecar to dist/core
npm run build:core
# 5. Start the UI dev server (browser, no VS Code needed)
npm run dev
Running & Debugging
Press F5 in VS Code to launch a new Extension Development Host window with the extension loaded. The host reloads automatically after npm run esbuild.
To iterate on the UI without a full VS Code instance, use the Run Mock Extension (Browser) launch configuration. It builds the web bundle and starts the dev server at http://localhost:3729, loading the UI with realistic mock NuGet data (packages, projects, vulnerabilities, etc.) injected via tools/mock-api.js. No .csproj files or dotnet CLI required.
Alternatively, run it directly from the terminal:
npm run dev
Code Style
npm run lint # Check for lint errors (ESLint 9)
npm run lint:fix # Auto-fix fixable issues
npm run typecheck # tsc over src and the TS test project
dotnet build NugetPackageManager.slnx -c Release # C# core
- TypeScript strict mode —
anyis a warning, avoid it - C# —
net8.0, nullable enabled, warnings are errors, analyzers on (Directory.Build.props) - Unused variables: prefix with
_to suppress the warning - CSS in Lit components uses the
csstagged template literal and VS Code CSS variables (--vscode-*) - All written content in English: code comments, commit messages, JSDoc, documentation
Running Tests
npm test # Full test suite (VSCode Test CLI + Mocha)
npm run test-compile # Compile tests to out/ (required before npm test)
npm run test:e2e # End-to-end: real sidecar + real dotnet against a fixture project
TypeScript tests live in tests/NugetPackageManager.VSCode.Tests/**/*.test.ts, mirroring the
src/NugetPackageManager.VSCode.* layout; C# tests are the MSTest projects under
tests/NugetPackageManager.Core*.Tests. The TypeScript runner opens a headless VS Code Extension
Host; dotnet test NugetPackageManager.slnx runs the C# suites.
Quality Gate
The same checks run locally and in CI (.github/workflows/quality-gate.yml):
npm run quality # bundles, lint (ESLint + SonarJS), typecheck, C# build + tests, TS tests, npm audit
npm run quality:coverage # same, and writes coverage/lcov.info for SonarCloud
npm run quality must pass before a commit is pushed. The gate treats correctness and
security findings from eslint-plugin-sonarjs as errors and reports known
maintainability debt (complexity, nesting, regex cost) as warnings. The workflow also
runs a SonarQube Cloud scan and waits for the server-side quality gate
(sonar.qualitygate.wait=true) when the SONAR_TOKEN repository secret is configured;
without it, the scan step is skipped with a warning.
Updating Screenshots
After UI changes, regenerate the screenshots and animated GIF automatically:
npm run esbuild # Rebuild bundles first
npm run docs # Generates docs/images/*.png and docs/images/demo.gif
The script (tools/generate-docs.mjs) starts a local HTTP server, loads the UI with mock data in a headless Chromium browser via Playwright, captures each tab, and assembles the animated GIF.
Building a .vsix Package
npm run package
# → releases/nugetpackagemanager-x.x.x.vsix
Releasing
Versions are automatic — do not bump package.json by hand. Every push to main
runs .github/workflows/release.yml, which derives YYYY.1MMdd.1HHmm from the UTC
build time (the same scheme as the AI repo), sets it for the build only, runs the
quality gate, publishes the same .vsix to the VS Code Marketplace and to
Open VSX (GitHub trusted publishing, no stored token), and creates a tag (no v
prefix) plus a GitHub Release with generated notes. main is never modified and no
changelog or release-notes file is committed. See docs/publishing.md.
Pull Request Guidelines
- Fork the repository and create a feature branch from
main - Make your changes — small, focused PRs are easier to review
- Add or update tests for changed behaviour
- Run
npm run quality— it must pass - Write a clear PR description explaining the why, not just the what
- Reference any related issues with
Closes [#123](https://github.com/I-Synergy/NugetPackageManager/issues/123)
Commit messages follow Conventional Commits:
feat:, fix:, refactor:, chore:, docs:, test:, perf:
AI Agent Roster
AI-assisted work in this repository is orchestrated from AGENTS.md and delegated to the agents in
.ai/agents/ (mirrored into .claude/agents, .github/agents and .reasonix/agents):
| Agent | Use for |
|---|---|
architect |
Feature design, pattern selection, component boundaries, architecture analysis |
designer |
Visual design — colour, typography, spacing, branding, design tokens, contrast |
reviewer |
Code quality, TypeScript/Lit and C# review, security review, architecture audit |
security |
Blast-radius and exposure analysis, threat modelling, OWASP review, dependency and secret audits |
tester |
Mocha/Sinon and MSTest test design, integration strategy |
developer |
TypeScript and C# implementation — host, RPC, core handlers, adapters, refactoring, builds |
ui-developer |
Lit components, layouts, CSS, UX patterns |
ui-tester |
Playwright E2E tests, accessibility checks, visual regression |
writer |
READMEs, CHANGELOG, ADRs, technical prose |
Architecture
The extension has two isolated contexts that communicate via a typed RPC layer over postMessage, and delegates the NuGet domain to a .NET sidecar process:
┌─────────────────────────────────────────────┐ ┌──────────────────────────────────────────────┐
│ VS Code Extension Host (Node.js) │ │ Webview (Browser / Lit) │
│ │ │ │
│ src/NugetPackageManager.VSCode.Host/ │ │ src/NugetPackageManager.VSCode.Webview/ │
│ extension.ts, host-api.ts, utilities/ │◄──►│ main.ts → packages-view │
│ nuget/ (core-process, core-client) │ │ components/* (@state, @property) │
└─────────────────────────────────────────────┘ └──────────────────────────────────────────────┘
postMessage RPC: { type, id, method, params } / { type, id, result }
│
│ sidecar JSON-RPC over stdio
▼
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
│ .NET core (dist/core, net8.0) — src/NugetPackageManager.Core* │
│ Core: protocol + handlers Core.NuGet: source client, config, advisories │
│ Core.Workspace: csproj model, CPM resolution, target frameworks, dependency graph │
└─────────────────────────────────────────────────────────────────────────────────────────────┘
Key design decisions:
- Typed RPC —
HostAPIinterface insrc/NugetPackageManager.VSCode.Common/rpc/types.tsis the single source of truth for all IPC. Every method returnsResult<T>(a discriminated union), so error paths are always explicit. - .NET sidecar — NuGet access, the project model, CPM resolution, dependency analysis and toolchain detection live in C# (
NugetPackageManager.slnx) and are reached over a stdio JSON protocol. A missing or failing core surfaces as a structured error, never a crashed host. - MSBuild-evaluated versions —
dotnet msbuild -getItem:PackageVersionsupplies effective package versions, anddotnet msbuild -ppmaps a property definition to the file that really declares it. Both live inCore.Workspace/Cpm/(CpmEvaluator,CpmPropertyLocator), are cached in the sidecar, and the write path snapshots a property file alongsideDirectory.Packages.props. - Marketplace-style full-page UI — the entire interface opens in an editor tab with framework-grouped cards, a sidebar launcher and VS Code theme-aware surfaces.
- Lit web components — built with LitElement + native HTML elements styled via VS Code CSS variables. No frameworks, no heavy dependencies in the webview bundle.
- Dual bundle + sidecar — esbuild produces two bundles,
dist/extension.js(Node.js CommonJS for the host) anddist/web.js(ESM for the webview);npm run build:corepublishes the C# sidecar todist/core. - One solution, both languages —
NugetPackageManager.slnxlists the TypeScript entry points and configs under/TypeScript*/solution folders so Visual Studio shows both halves; those are solution items, anddotnet buildignores them.
Source layout:
src/
├── NugetPackageManager.Core/ # .NET sidecar entry point, protocol, handlers
├── NugetPackageManager.Core.NuGet/ # NuGet source client, nuget.config, advisories
├── NugetPackageManager.Core.Workspace/ # csproj model, CPM + property evaluation, target frameworks, dependencies
├── NugetPackageManager.VSCode.Common/ # Shared between host and web (RPC protocol, types)
│ └── rpc/ # RpcHost, RpcClient, types, Result<T>
├── NugetPackageManager.VSCode.Host/ # Extension host (Node.js context)
│ ├── extension.ts # Activation, full-page WebviewPanel, activity-bar launcher
│ ├── host-api.ts # HostAPI implementation
│ ├── nuget/ # Core bridge (core-process, core-client), source adapters
│ └── utilities/ # CPM adapters, task executor, jobs, SDK, decorator
└── NugetPackageManager.VSCode.Webview/ # Webview UI (browser context)
├── main.ts # Root element, routing
├── components/ # LitElement components (packages-view, updates-view, …)
├── styles/ # Shared CSS (VS Code variables, codicons, scrollbars)
└── registrations.ts # Module-level singletons (hostApi, router, configuration)
tests/
├── NugetPackageManager.VSCode.Tests/ # TypeScript tests (Mocha + Sinon)
├── NugetPackageManager.Core.Tests/ # MSTest — sidecar protocol and handlers
├── NugetPackageManager.Core.NuGet.Tests/
├── NugetPackageManager.Core.Workspace.Tests/
└── NugetPackageManager.TestUtilities/ # Shared C# test helpers (TestPaths, TemporaryDirectory)
└── Fixtures/ # MSBuild/CPM fixtures evaluated at runtime
Performance and Memory
The NuGet domain was moved out of the extension host into the .NET sidecar on purpose: the host keeps only what the VS Code API requires (activation, webview, commands, spawning, progress, cancellation), and everything that parses or resolves runs in C#. This section records what that trade measured, rather than asserting that "C# is faster".
Both implementations were benchmarked against each other before the TypeScript code was deleted —
CpmResolver (TypeScript, commit 389efd0) versus CpmPropsReader (C#, commit db15414) — on
identical inputs, with all 13 CPM fixtures producing identical output.
Reading Directory.Packages.props
| Workload | TypeScript in the host | C# in the core | C# end-to-end (through the sidecar) |
|---|---|---|---|
| 1,000 packages / 128.5 KiB props file | 24.1 ms | 4.2 ms | 2.3 ms |
| Typical 3-package fixture | 0.160 ms | 0.094 ms | 0.25 ms |
| Transient heap per parse (large file) | 922 KiB | 230 KiB host + 933 KiB core | — |
| Retained memory per parsed map | ~127 KiB | ~1 KiB | — |
Sidecar footprint
| State | Resident memory |
|---|---|
| Idle after start | 28.3 MiB |
| After 50 reads of the large file | 51.1 MiB |
| After a 200-read burst (peak / settled) | 59.8 MiB / ~50.5 MiB |
| After 50 reads of a 3-package file | 45.6 MiB |
The footprint plateaus rather than growing without bound, and it does not scale with the size of the props file — the cost is the .NET process plus per-request garbage, not the parsed document.
What this means in practice
- Large projects get faster. Reading a 1,000-package props file is roughly 10× faster end-to-end, and the extension host no longer builds DOM trees or blocks on the parse.
- Small projects are at parity. A 3-package file takes 0.25 ms through the sidecar versus 0.16 ms in-process; the round trip is the floor, and no user can perceive the difference.
- Total allocation is unchanged. About 1.1 MiB is allocated per parse in both designs. The port moved the work between processes; it did not remove it.
- Memory went up, not down. The extension gains a second process at ~28 MiB idle and ~45–60 MiB under load, while the host pays ~4× less garbage per parse.
- The first call in a session pays the start. The sidecar announces readiness in ~0.1 s, after which calls are warm. It is stopped when the extension deactivates.
- Version resolution (
ResolveVersions, 1,000 packages × 2 frameworks) is 1.4× faster in C# (18.7 ms vs 25.9 ms) but allocates substantially more per call (44.4 MiB vs 0.8 MiB); that allocation is tracked as a follow-up.
Packaging
The sidecar ships as a framework-dependent .NET 8 build (~4.4 MB, 21 files) and is launched with
the dotnet already on PATH, so one VSIX serves every OS and architecture. PublishReadyToRun
was measured at 2.5× the size with no startup gain (67 ms either way), and a trimmed,
self-contained build does not start at all because the protocol relies on reflection-based
System.Text.Json. Neither is shipped.
How these numbers were produced
Three interleaved paired rounds of 5 warm-up plus 30 measured iterations, medians reported, on
Windows 11 arm64 with Node.js 26.12.1 and .NET SDK 11.0.100-rc.3 (the core runs on runtime 8.0.33).
The large workload is synthetic and deliberately larger than a typical Directory.Packages.props;
the real fixture is reported alongside it for exactly that reason. These are single-machine
relative measurements — treat the deltas as engineering evidence, not portable absolutes. The full
report, including the parity comparison and method: .ai/completed/memory-cpm-ts-vs-cs.md.
Credits
NuGet Package Manager for Visual Studio Code builds on the work of:
- nuget-workbench - the original vscode extension from which we forked
- pcislo/vscode-nuget-gallery by Patryk Cislo — the original extension this project descends from
- shis91/vscode-nuget-gallery by shis91 — major feature additions including CPM, authentication, and test infrastructure
License
Standards Compatibility
Engineering artifacts produced by this repository correspond to published standards, and their status
is computed from validator runs rather than asserted. The full view — what is produced, what is
aligned in practice only, and what stays outside a code repository's reach — is in
COMPLIANCE.md.
| Compatibility | Meaning | Standards |
|---|---|---|
| Evidence | An artifact a certification auditor can sample directly | (none) |
| Aligned | Engineering practice follows the standard's model; no audit artifact is produced | ISO/IEC/IEEE 29119-3:2021, ISO/IEC 25010:2023 |
| Organizational | Certifiable only at organization level; this repository supplies nothing for it | ISO/IEC 27001, ISO/IEC 27701 / ISO/IEC 27017 / ISO/IEC 27018, ISO 9001, ISO/IEC 15504 / ISO/IEC 33001, IEC 62304, ISO/IEC 42001 |
This is not a certification and it asserts no conformity with any standard. Certification is issued by an accredited third-party body after auditing an organizational management system; it cannot be established by a code repository.









