From 2a60d963c34f968ef8a4f046e03ae72928b417b8 Mon Sep 17 00:00:00 2001 From: Arturo Ortiz <58537168+aortiz-msft@users.noreply.github.com> Date: Mon, 23 Mar 2026 15:46:40 -0700 Subject: [PATCH 1/6] Create ARCHITECTURE.md --- ARCHITECTURE.md | 367 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 367 insertions(+) create mode 100644 ARCHITECTURE.md diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 00000000000..98039f0d771 --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,367 @@ +# Architecture + +This document describes the high-level architecture of NuGet.Client. +If you want to familiarize yourself with the codebase, you are in the right place! + +See also the auto-generated [project overview](docs/project-overview.md), the [feature guide](docs/feature-guide.md), and the [coding guidelines](docs/coding-guidelines.md). + +## Bird's Eye View + +NuGet is the package manager for .NET. This repository contains the client-side implementation — everything that runs on a developer's machine (or CI) to discover, install, restore, and manage NuGet packages. The server-side (nuget.org, feeds) lives elsewhere. + +The repository ships **three distinct products** built from a shared set of core libraries: + +1. **Package Manager for Visual Studio** — A Visual Studio extension providing the Package Manager UI dialog, the PowerShell Package Manager Console, solution-level restore integrated with the VS build system, and extensibility APIs for third-party VS extensions. + +2. **Command-line tools** — Two separate executables: `NuGet.exe` (a .NET Framework console application, self-contained via ILRepack) and the cross-platform `dotnet nuget` commands (integrated into the .NET SDK via `NuGet.CommandLine.XPlat`). + +3. **MSBuild integration** — The `NuGet.Build.Tasks` and `NuGet.Build.Tasks.Pack` libraries provide the MSBuild targets and tasks that power `dotnet restore`, `dotnet pack`, and SDK resolution via `Microsoft.Build.NuGetSdkResolver`. + +All three products share a common foundation of core libraries (`src/NuGet.Core/`) that implement package resolution, protocol handling, versioning, configuration, and packaging. + +## Repository Layout + +The code is organized into a single solution (`NuGet.sln`) with solution filter files (`.slnf`) for loading subsets: + +``` +NuGet.Client/ +├── src/ +│ ├── NuGet.Core/ # Platform-independent core libraries (19 projects) +│ └── NuGet.Clients/ # VS extension, NuGet.exe, and VS-specific code (16 projects) +├── test/ +│ ├── NuGet.Core.Tests/ # Unit tests for core libraries +│ ├── NuGet.Core.FuncTests/ # Integration tests for core (dotnet, msbuild scenarios) +│ ├── NuGet.Clients.Tests/ # Unit tests for VS and CLI components +│ ├── NuGet.Clients.FuncTests/# Functional tests for NuGet.exe +│ ├── NuGet.Tests.Apex/ # VS UI automation tests +│ └── TestUtilities/ # Shared test infrastructure +├── build/ # Build props, targets, and shared source files +├── setup/ # Visual Studio installer (SWIX) packaging +├── docs/ # Developer documentation +└── eng/ # Engineering system (CI/CD pipelines) +``` + +Solution filters for focused development: +- `NuGet-VS.slnf` — Visual Studio extension projects only +- `NuGet-Src-Commandline.slnf` — NuGet.exe and all core libraries +- `NuGet-Src.slnf` — All source projects (no tests) +- `NuGet-UnitTests.slnf` — All source plus unit tests +- `NuGet-Commandline-WithTests.slnf` — CLI projects plus their tests + +## Code Map + +This section describes the important projects and how they relate to each other. Pay attention to the **Architecture Invariant** sections. They often describe things that are deliberately _absent_ from the code. + +The dependency graph flows strictly downward: Visual Studio client code depends on core libraries, never the reverse. Within the core, lower-level libraries (versioning, frameworks) have no upward dependencies. + +### Core Libraries (`src/NuGet.Core/`) + +These are the foundational libraries shared by all NuGet products. They are multi-targeted (`net472`, `netstandard2.0`, `net8.0`+) and have no dependency on Visual Studio or any specific host. + +#### `NuGet.Versioning` + +NuGet's implementation of Semantic Versioning. Defines `NuGetVersion`, `SemanticVersion`, `VersionRange`, `FloatRange`, and version comparison/formatting logic. This is a leaf dependency — it depends on nothing else in the repo. + +#### `NuGet.Frameworks` + +NuGet's understanding of .NET target frameworks. Defines `NuGetFramework`, `CompatibilityProvider`, `FrameworkReducer`, and framework name mappings. Another leaf dependency. The `def/` subdirectory contains the built-in framework compatibility definitions. + +**Architecture Invariant:** `NuGet.Versioning` and `NuGet.Frameworks` are leaf libraries with zero internal dependencies. They are usable in isolation. + +#### `NuGet.Common` + +Shared utilities, logging infrastructure (`ILogger`), telemetry, error types, and cross-cutting helpers. Depends only on `NuGet.Frameworks`. + +#### `NuGet.Configuration` + +Reads and writes NuGet configuration (`NuGet.Config` files). Defines `PackageSource`, `ISettings`, credential storage, proxy configuration, client certificates, and package source mapping. The `Settings/` subdirectory contains the XML read/write logic. + +Depends on: `NuGet.Common`, `NuGet.Frameworks`. + +#### `NuGet.Packaging` + +NuGet's understanding of `.nupkg` files and `.nuspec` metadata. Provides `PackageArchiveReader`, `NuspecReader`, `PackagesConfigReader`, `PackageExtractor`, content model resolution, and the complete package signing infrastructure (in `Signing/`). Also defines the `NuGet.Packaging.Core` types such as `PackageIdentity` and `PackageDependency`. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Versioning`. + +**Architecture Invariant:** `NuGet.Packaging` knows how to read and write packages but knows nothing about where they come from (feeds, caches). Feed interaction is handled by `NuGet.Protocol`. + +#### `NuGet.Protocol` + +Implements communication with NuGet feeds — both the legacy V2 (OData) protocol and the modern V3 (JSON-based) service index protocol. Defines `SourceRepository`, resource providers, HTTP source handling, local folder repositories, and the plugin credential/download system (in `Plugins/`). The `SourceCacheContext` controls HTTP caching behavior. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Versioning`. + +#### `NuGet.LibraryModel` + +Data model for library/package dependencies. Defines `LibraryRange`, `LibraryIdentity`, `LibraryDependency`, `LibraryType`, and `FrameworkDependency`. These are the types used by the dependency resolver to describe what a project needs. + +Depends on: `NuGet.Common`, `NuGet.Frameworks`, `NuGet.Versioning`. + +#### `NuGet.DependencyResolver.Core` + +The graph-based dependency resolution engine for PackageReference projects. Walks the dependency graph using `GraphNode`, resolving version conflicts and computing the transitive closure. The `Remote/` subdirectory handles fetching dependency info from remote feeds. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. + +#### `NuGet.Resolver` + +The dependency resolver for `packages.config` projects. Uses `PackageResolver` with a different algorithm than the PackageReference resolver. This is the older resolution strategy. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. + +**Architecture Invariant:** There are two separate resolvers — `NuGet.DependencyResolver.Core` for PackageReference and `NuGet.Resolver` for packages.config. They share the same lower-level libraries but implement fundamentally different resolution strategies. + +#### `NuGet.ProjectModel` + +Defines the data model for PackageReference-based restore: `PackageSpec` (the in-memory representation of a project's NuGet configuration), `DependencyGraphSpec` (the complete restore input graph), `LockFile` / `LockFileFormat` (the `project.assets.json` output), and `ProjectRestoreMetadata`. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. + +#### `NuGet.Credentials` + +Credential provider infrastructure. Defines `ICredentialProvider`, `CredentialService`, and the plugin-based credential provider model. Handles authentication handshakes with feeds. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. + +#### `NuGet.Commands` + +High-level command implementations shared by all clients. `RestoreCommand`, `PackCommand`, `SignCommand`, `VerifyCommand`, `ListPackageCommand`, and others. This is the **API Boundary** between the core logic and the various hosts (CLI, VS, MSBuild). Each host translates its inputs into the command argument types defined here, then delegates to the command runners. + +Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. + +**Architecture Invariant:** `NuGet.Commands` is the **primary API boundary**. It contains the shared business logic for operations like restore, pack, and sign. The CLI executables, MSBuild tasks, and VS extension all call into this layer. Nothing in `NuGet.Commands` knows about MSBuild, Visual Studio, or any specific CLI framework. + +#### `NuGet.PackageManagement` + +Package management orchestration for install/uninstall/update flows (primarily used by the Visual Studio client and NuGet.exe `install`/`update` commands). Defines `NuGetPackageManager`, the abstract `NuGetProject` base class, and concrete project types like `MSBuildNuGetProject`, `FolderNuGetProject`, and `BuildIntegratedNuGetProject`. The `Audit/` subdirectory handles package vulnerability auditing. + +Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Resolver`, `NuGet.Versioning`. + +#### `NuGet.Localization` + +Localization satellite assemblies for the dotnet CLI. Leaf dependency. + +### MSBuild Integration (`src/NuGet.Core/`) + +#### `NuGet.Build.Tasks` + +MSBuild tasks and targets that implement `dotnet restore` and `msbuild /t:Restore`. The `RestoreTask` class implements `ICancelableTask` and delegates to `RestoreCommand` from `NuGet.Commands`. Ships the `NuGet.targets` and `NuGet.props` files that are imported by the .NET SDK into every project. + +Also contains the `NuGet.RestoreEx.targets` file used for static graph restore, which evaluates the entire project graph up-front for better performance. + +Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.PackageManagement`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. + +#### `NuGet.Build.Tasks.Console` + +A standalone console executable (`NuGet.Build.Tasks.Console.exe`) that runs restore using MSBuild's static graph functionality. This is the out-of-process restore host invoked by the `RestoreTaskEx` MSBuild task for improved performance and isolation. + +Depends on: `NuGet.Build.Tasks` and all transitive core libraries. + +#### `NuGet.Build.Tasks.Pack` + +MSBuild tasks and targets for `dotnet pack`. The `PackTask` class creates `.nupkg` files from project metadata. Ships the `NuGet.Build.Tasks.Pack.targets` file. Supports multi-targeted projects, symbol packages, and deterministic packaging. + +Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. + +#### `Microsoft.Build.NuGetSdkResolver` + +An MSBuild SDK resolver (priority 6000) that resolves MSBuild SDKs distributed as NuGet packages. Reads the `msbuild-sdks` section from `global.json` and performs a NuGet restore to obtain the SDK package. Can be disabled via the `MSBUILDDISABLENUGETSDKRESOLVER` environment variable. Avoids loading NuGet assemblies unless an SDK actually needs resolution. + +Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. + +### Command-Line Tools + +#### `NuGet.CommandLine` (`src/NuGet.Clients/`) + +The `NuGet.exe` console application. Targets .NET Framework 4.7.2 only. Uses **ILRepack** to merge all dependent assemblies into a single self-contained executable. Commands are discovered via MEF (`[Export]` attributes on `ICommand` implementations), and third-party extensions can be loaded from configurable extension directories. + +The `Program` class is the entry point. `CommandManager` handles command registration and dispatch. + +Depends on: `NuGet.Build.Tasks`, `NuGet.Commands`, `NuGet.PackageManagement`, and all transitive core libraries. + +**Architecture Invariant:** `NuGet.CommandLine` is .NET Framework only. It is the legacy CLI tool. The cross-platform equivalent is `NuGet.CommandLine.XPlat`. + +#### `NuGet.CommandLine.XPlat` (`src/NuGet.Core/`) + +The cross-platform CLI that powers `dotnet nuget` commands. Integrated into the .NET SDK — the SDK calls `NuGetCommands.Add(RootCommand, ...)` to register NuGet's commands into the `dotnet` command tree. Uses a mix of `System.CommandLine` (newer commands like `config`, `why`, `package search`) and `Microsoft.Extensions.CommandLineUtils` (older commands like `delete`, `push`, `locals`). + +Depends on: `NuGet.Commands` (and transitive core libraries). + +**Architecture Invariant:** despite living under `src/NuGet.Core/`, this project is an executable entry point, not a reusable library. It lives in `NuGet.Core` because it targets modern .NET only and has no Visual Studio dependencies. + +### Visual Studio Extension (`src/NuGet.Clients/`) + +The VS extension is packaged as a VSIX (`NuGet.VisualStudio.Client`) and ships as a system component of Visual Studio. It registers two `AsyncPackage` classes, exposes functionality via MEF exports, and provides brokered services for out-of-process access. + +#### `NuGet.Tools` + +The main Visual Studio package. `NuGetPackage` (inherits `AsyncPackage`) registers menu commands, tool windows, settings pages, brokered services, and the NuGet search provider. It is the entry point that wires together the Package Manager UI, the PowerShell Console, and all NuGet services within VS. + +Key responsibilities: launches the Package Manager dialog (project-level and solution-level), hosts the `PowerConsoleToolWindow`, registers brokered services via `NuGetBrokeredServiceFactory`, and persists solution-level user options. + +Depends on: nearly all other NuGet.Clients projects plus core libraries. + +#### `NuGet.SolutionRestoreManager` + +The second VS package. `RestoreManagerPackage` auto-loads when a solution is open and hooks into VS build events. `SolutionRestoreBuildHandler` triggers restore before build. `SolutionRestoreWorker` executes restore jobs. `VsSolutionRestoreService` exposes restore as a brokered service. + +Also provides the `AuditCheckResultCachingService` for vulnerability checks and `VulnerablePackagesInfoBar` for user notifications. + +Depends on: `NuGet.PackageManagement.VisualStudio`, `NuGet.VisualStudio.Common`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. + +#### `NuGet.PackageManagement.UI` + +WPF-based Package Manager dialog. `PackageManagerControl` is the main UI control. `NuGetUIFactory` creates UI contexts. `PackageItemLoader` handles lazy-loading with infinite scroll. The UI communicates with the core through brokered service proxies defined in `NuGet.VisualStudio.Internal.Contracts`. + +Depends on: `NuGet.PackageManagement.VisualStudio`, `NuGet.Indexing`, `NuGet.VisualStudio.Common`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. + +#### `NuGet.Console` + +The PowerShell Package Manager Console. `PowerConsoleToolWindow` hosts a WPF-based terminal. `WpfConsoleService` manages the console output. Provides IntelliSense via `CompletionSourceProvider` and syntax highlighting via `ClassifierProvider`. + +#### `NuGet.PackageManagement.PowerShellCmdlets` + +PowerShell cmdlet implementations (`Install-Package`, `Update-Package`, `Uninstall-Package`, `Get-Package`, etc.) that run within the Package Manager Console. These cmdlets call into `NuGet.PackageManagement` for the actual operations. + +#### `NuGet.PackageManagement.VisualStudio` + +VS-specific package management infrastructure. `VSSolutionManager` tracks the loaded solution and projects. Provides project system adapters (`CpsPackageReferenceProjectProvider`, `LegacyPackageReferenceProjectProvider`, `MSBuildNuGetProjectProvider`) that bridge the VS project system to `NuGetProject` types in `NuGet.PackageManagement`. Also handles VS credentials, settings, and source control integration. + +Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.Indexing`, `NuGet.VisualStudio.Common`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. + +#### `NuGet.VisualStudio.Common` + +Shared infrastructure used by all VS client projects. Contains telemetry (`NuGetTelemetryProvider`), experimentation/A/B testing (`NuGetExperimentationService`), the error list integration, output window logging, and the `ServiceLocator` that provides static access to MEF-composed services. + +Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.VisualStudio`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. + +#### `NuGet.VisualStudio` + +The public extensibility API for third-party VS extensions. Defines interfaces like `IVsPackageInstaller`, `IVsPackageUninstaller`, `IVsPackageRestorer`, `IVsFrameworkParser`, and `IVsPathContextProvider`. Also defines the `IVsSolutionRestoreService` interface for restore manager interop. This is an **API boundary** — it is a NuGet package consumed by third-party extensions. + +**Architecture Invariant:** `NuGet.VisualStudio` is a leaf dependency containing only interfaces and simple types. It has no dependency on any other NuGet assembly. This allows third-party extensions to reference it without pulling in the entire NuGet stack. + +#### `NuGet.VisualStudio.Contracts` + +Public Service Broker extensibility contracts. Defines `INuGetProjectService` for out-of-process VS extensions to query installed packages. Like `NuGet.VisualStudio`, this is a leaf dependency shipped as a NuGet package. + +**Architecture Invariant:** `NuGet.VisualStudio.Contracts` has no internal NuGet dependencies, keeping the public API surface minimal and stable. + +#### `NuGet.VisualStudio.Implementation` + +Implements the extensibility interfaces from `NuGet.VisualStudio`. `VsPackageInstaller`, `VsPackageRestorer`, `VsPackageUninstaller`, `VsFrameworkParser`, `VsPathContextProvider` are all MEF exports. Also provides the Solution Explorer integration (`PackageReferenceAttachedCollectionSourceProvider`) and template wizard support (`VsTemplateWizard`). + +#### `NuGet.VisualStudio.Internal.Contracts` + +Internal service contracts for brokered service communication within VS. Defines `INuGetSolutionManagerService`, `INuGetProjectManagerService`, `INuGetSearchService`, `INuGetSourcesService`, and `INuGetProjectUpgraderService`. These are not part of the public API. Uses MessagePack serialization for RPC. + +#### `NuGet.VisualStudio.Interop` + +COM interop assembly for the VS template wizard. Bridges `NuGet.VisualStudio.Implementation` template wizard to VS via COM. Depends only on `NuGet.VisualStudio`. + +#### `NuGet.VisualStudio.Client` + +The VSIX project that packages the entire VS extension. Contains the `source.extension.vsixmanifest` that declares all VS packages, MEF components, and bundled assemblies. This is not a code project — it is the packaging and deployment artifact. + +#### `NuGet.Indexing` + +Package search indexing and result aggregation for the VS Package Manager UI. Uses Lucene.Net for relevance ranking and `SearchResultsAggregator` to merge results from multiple feeds. + +#### `NuGet.MSSigning.Extensions` + +Extension commands for repository signing (`NuGet.exe reposign`, `NuGet.exe sign`). Extends `NuGet.CommandLine` with additional signing functionality. + +## Dependency Layers + +The projects form a strict layering. Dependencies flow downward only: + +``` +┌─────────────────────────────────────────────────────────────┐ +│ VISUAL STUDIO HOST │ +│ NuGet.VisualStudio.Client (VSIX packaging) │ +│ NuGet.Tools (main VS package) │ +│ NuGet.SolutionRestoreManager (restore VS package) │ +│ NuGet.Console, NuGet.PackageManagement.PowerShellCmdlets │ +│ NuGet.PackageManagement.UI │ +├─────────────────────────────────────────────────────────────┤ +│ VS INTEGRATION LAYER │ +│ NuGet.PackageManagement.VisualStudio │ +│ NuGet.VisualStudio.Common │ +│ NuGet.VisualStudio.Implementation │ +│ NuGet.VisualStudio.Internal.Contracts │ +│ NuGet.Indexing │ +├────────────────────┬──────────────────┬─────────────────────┤ +│ PUBLIC API │ CLI HOSTS │ MSBUILD HOSTS │ +│ NuGet.VisualStudio│ NuGet.exe │ NuGet.Build.Tasks │ +│ NuGet.VS.Contracts│ NuGet.XPlat │ NuGet.Build.Pack │ +│ NuGet.VS.Interop │ NuGet.MSSigning │ NuGet.Build.Console│ +│ │ │ NuGetSdkResolver │ +├────────────────────┴──────────────────┴─────────────────────┤ +│ COMMAND LAYER │ +│ NuGet.Commands (restore, pack, sign, verify, list, ...) │ +│ NuGet.PackageManagement (install, update, uninstall) │ +│ NuGet.Credentials │ +├─────────────────────────────────────────────────────────────┤ +│ DATA MODEL LAYER │ +│ NuGet.ProjectModel (PackageSpec, LockFile, DependencyGraph)│ +│ NuGet.DependencyResolver.Core (graph-based resolution) │ +│ NuGet.Resolver (packages.config resolution) │ +├─────────────────────────────────────────────────────────────┤ +│ PROTOCOL LAYER │ +│ NuGet.Protocol (V2/V3 feeds, HTTP, local, plugins) │ +├─────────────────────────────────────────────────────────────┤ +│ CORE MODEL LAYER │ +│ NuGet.Packaging (nupkg, nuspec, signing, content model) │ +│ NuGet.LibraryModel (dependency types) │ +│ NuGet.Configuration (NuGet.Config, package sources) │ +│ NuGet.Common (logging, utilities) │ +├─────────────────────────────────────────────────────────────┤ +│ FOUNDATION LAYER │ +│ NuGet.Frameworks (target framework parsing/compatibility) │ +│ NuGet.Versioning (semantic version parsing/comparison) │ +└─────────────────────────────────────────────────────────────┘ +``` + +## Cross-Cutting Concerns + +### Shared Source Files + +The `build/Shared/` directory contains `.cs` files that are compiled directly into multiple assemblies via `` in project files. This avoids adding assembly dependencies for small utility code. Key shared files include `HashCodeCombiner.cs`, `XmlUtility.cs`, `SharedExtensions.cs`, `TaskResult.cs`, and `Utf8JsonStreamReader.cs`. + +### Multi-targeting + +Core libraries target `net472`, `netstandard2.0`, and modern .NET (currently `net8.0` / `net10.0`). The VS client projects target `net472` only (VS runs on .NET Framework). The XPlat CLI and Build.Tasks.Console target modern .NET only. Target framework constants are defined in `build/config.props`. + +### Central Package Management + +All NuGet package versions are centrally managed in the root `Directory.Packages.props` file (110+ dependencies). Individual projects use `` without specifying versions — the version comes from the central file. + +### Brokered Services (VS) + +The VS extension uses Visual Studio's brokered service infrastructure for RPC communication. Services are defined in `NuGet.VisualStudio.Internal.Contracts` and registered in `NuGetBrokeredServiceFactory` (in `NuGet.Tools`). This architecture allows NuGet services to be accessed from out-of-process VS extensions. Serialization uses MessagePack. + +### MEF Composition (VS) + +The VS extension uses MEF (Managed Extensibility Framework) extensively for service discovery and dependency injection. Key exports include `VSSolutionManager`, `ExtensibleSourceRepositoryProvider`, `NuGetUIFactory`, `VsPackageInstaller`, and the PowerShell console providers. Services are composed by VS's `SComponentModel`. + +### Two Extensibility Models (VS) + +NuGet exposes two VS extensibility surfaces: +- **In-process (MEF):** `NuGet.VisualStudio` interfaces (`IVsPackageInstaller`, etc.) — consumed by third-party extensions loading in the same VS process. +- **Out-of-process (Service Broker):** `NuGet.VisualStudio.Contracts` (`INuGetProjectService`) — consumed by extensions that may run out-of-process. + +Both are leaf assemblies with no internal NuGet dependencies, ensuring a stable public API surface. + +### Build System + +The build uses MSBuild with shared properties in `Directory.Build.props` / `Directory.Build.targets` at the root, and layer-specific overrides in `src/NuGet.Core/` and the individual project directories. The `build/` directory contains common build configuration (`config.props`, `common.project.props`). CI/CD is configured in `eng/` and `.azuredevops/`. The `build.cmd` / `build.ps1` scripts are the top-level build entry points. + +### Testing Strategy + +Tests are organized to mirror the source structure: +- **Unit tests** (`test/NuGet.Core.Tests/`, `test/NuGet.Clients.Tests/`) — fast, isolated tests for individual libraries. +- **Functional tests** (`test/NuGet.Core.FuncTests/`, `test/NuGet.Clients.FuncTests/`) — integration tests that exercise real MSBuild, dotnet CLI, or NuGet.exe scenarios. +- **Apex tests** (`test/NuGet.Tests.Apex/`) — VS UI automation tests using the Test.Apex framework. + +Test utilities in `test/TestUtilities/` provide mock feeds, test project scaffolding, and shared test infrastructure. From ffd130254d2556f1ec6911218584a4cfa9800f7a Mon Sep 17 00:00:00 2001 From: Arturo Ortiz <58537168+aortiz-msft@users.noreply.github.com> Date: Tue, 24 Mar 2026 10:50:28 -0700 Subject: [PATCH 2/6] Firs round of updates from review --- ARCHITECTURE.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 98039f0d771..f49eca51245 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -50,13 +50,13 @@ Solution filters for focused development: ## Code Map -This section describes the important projects and how they relate to each other. Pay attention to the **Architecture Invariant** sections. They often describe things that are deliberately _absent_ from the code. +This section describes the important projects and how they relate to each other. Pay attention to the **Design Rule** sections. They often describe things that are deliberately _absent_ from the code. The dependency graph flows strictly downward: Visual Studio client code depends on core libraries, never the reverse. Within the core, lower-level libraries (versioning, frameworks) have no upward dependencies. ### Core Libraries (`src/NuGet.Core/`) -These are the foundational libraries shared by all NuGet products. They are multi-targeted (`net472`, `netstandard2.0`, `net8.0`+) and have no dependency on Visual Studio or any specific host. +These are the foundational libraries shared by all NuGet products. They are multi-targeted (`net472` and `net8.0`) and have no dependency on Visual Studio or any specific host. #### `NuGet.Versioning` @@ -66,7 +66,7 @@ NuGet's implementation of Semantic Versioning. Defines `NuGetVersion`, `Semantic NuGet's understanding of .NET target frameworks. Defines `NuGetFramework`, `CompatibilityProvider`, `FrameworkReducer`, and framework name mappings. Another leaf dependency. The `def/` subdirectory contains the built-in framework compatibility definitions. -**Architecture Invariant:** `NuGet.Versioning` and `NuGet.Frameworks` are leaf libraries with zero internal dependencies. They are usable in isolation. +**Design Rule:** `NuGet.Versioning` and `NuGet.Frameworks` are leaf libraries with zero internal dependencies. They are usable in isolation. #### `NuGet.Common` @@ -84,7 +84,7 @@ NuGet's understanding of `.nupkg` files and `.nuspec` metadata. Provides `Packag Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Versioning`. -**Architecture Invariant:** `NuGet.Packaging` knows how to read and write packages but knows nothing about where they come from (feeds, caches). Feed interaction is handled by `NuGet.Protocol`. +**Design Rule:** `NuGet.Packaging` knows how to read and write packages but knows nothing about where they come from (feeds, caches). Feed interaction is handled by `NuGet.Protocol`. #### `NuGet.Protocol` @@ -110,7 +110,7 @@ The dependency resolver for `packages.config` projects. Uses `PackageResolver` w Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. -**Architecture Invariant:** There are two separate resolvers — `NuGet.DependencyResolver.Core` for PackageReference and `NuGet.Resolver` for packages.config. They share the same lower-level libraries but implement fundamentally different resolution strategies. +**Design Rule:** There are two separate resolvers — `NuGet.DependencyResolver.Core` for PackageReference and `NuGet.Resolver` for packages.config. They share the same lower-level libraries but implement fundamentally different resolution strategies. #### `NuGet.ProjectModel` @@ -130,7 +130,7 @@ High-level command implementations shared by all clients. `RestoreCommand`, `Pac Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. -**Architecture Invariant:** `NuGet.Commands` is the **primary API boundary**. It contains the shared business logic for operations like restore, pack, and sign. The CLI executables, MSBuild tasks, and VS extension all call into this layer. Nothing in `NuGet.Commands` knows about MSBuild, Visual Studio, or any specific CLI framework. +**Design Rule:** `NuGet.Commands` is the **primary API boundary**. It contains the shared business logic for operations like restore, pack, and sign. The CLI executables, MSBuild tasks, and VS extension all call into this layer. Nothing in `NuGet.Commands` knows about MSBuild, Visual Studio, or any specific CLI framework. #### `NuGet.PackageManagement` @@ -146,21 +146,21 @@ Localization satellite assemblies for the dotnet CLI. Leaf dependency. #### `NuGet.Build.Tasks` -MSBuild tasks and targets that implement `dotnet restore` and `msbuild /t:Restore`. The `RestoreTask` class implements `ICancelableTask` and delegates to `RestoreCommand` from `NuGet.Commands`. Ships the `NuGet.targets` and `NuGet.props` files that are imported by the .NET SDK into every project. +MSBuild tasks and targets that implement `dotnet restore` and `msbuild /t:Restore`. The `RestoreTask` class delegates to `RestoreCommand` from `NuGet.Commands`. Ships the `NuGet.targets` and `NuGet.props` files that are imported by the .NET SDK into every project. -Also contains the `NuGet.RestoreEx.targets` file used for static graph restore, which evaluates the entire project graph up-front for better performance. +Also contains the `NuGet.RestoreEx.targets` file used for static graph restore, which uses MSBuild's static graph APIs to evaluate the project graph for better performance. Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.PackageManagement`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. #### `NuGet.Build.Tasks.Console` -A standalone console executable (`NuGet.Build.Tasks.Console.exe`) that runs restore using MSBuild's static graph functionality. This is the out-of-process restore host invoked by the `RestoreTaskEx` MSBuild task for improved performance and isolation. +A standalone console executable (`NuGet.Build.Tasks.Console.exe`) that runs restore using MSBuild's static graph functionality. This is the out-of-process restore host invoked by the `RestoreTaskEx` MSBuild task for improved performance. Depends on: `NuGet.Build.Tasks` and all transitive core libraries. #### `NuGet.Build.Tasks.Pack` -MSBuild tasks and targets for `dotnet pack`. The `PackTask` class creates `.nupkg` files from project metadata. Ships the `NuGet.Build.Tasks.Pack.targets` file. Supports multi-targeted projects, symbol packages, and deterministic packaging. +MSBuild tasks and targets for `dotnet pack`. The `PackTask` class creates `.nupkg` files from project metadata. Ships the `NuGet.Build.Tasks.Pack.targets` file. Supports multi-targeted projects and symbol packages. Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. @@ -180,7 +180,7 @@ The `Program` class is the entry point. `CommandManager` handles command registr Depends on: `NuGet.Build.Tasks`, `NuGet.Commands`, `NuGet.PackageManagement`, and all transitive core libraries. -**Architecture Invariant:** `NuGet.CommandLine` is .NET Framework only. It is the legacy CLI tool. The cross-platform equivalent is `NuGet.CommandLine.XPlat`. +**Design Rule:** `NuGet.CommandLine` is .NET Framework only. It is the legacy CLI tool. The cross-platform equivalent is `NuGet.CommandLine.XPlat`. #### `NuGet.CommandLine.XPlat` (`src/NuGet.Core/`) @@ -188,7 +188,7 @@ The cross-platform CLI that powers `dotnet nuget` commands. Integrated into the Depends on: `NuGet.Commands` (and transitive core libraries). -**Architecture Invariant:** despite living under `src/NuGet.Core/`, this project is an executable entry point, not a reusable library. It lives in `NuGet.Core` because it targets modern .NET only and has no Visual Studio dependencies. +**Design Rule:** despite living under `src/NuGet.Core/`, this project is an executable entry point, not a reusable library. It lives in `NuGet.Core` because it targets modern .NET only and has no Visual Studio dependencies. ### Visual Studio Extension (`src/NuGet.Clients/`) @@ -240,13 +240,13 @@ Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.VisualStudio`, ` The public extensibility API for third-party VS extensions. Defines interfaces like `IVsPackageInstaller`, `IVsPackageUninstaller`, `IVsPackageRestorer`, `IVsFrameworkParser`, and `IVsPathContextProvider`. Also defines the `IVsSolutionRestoreService` interface for restore manager interop. This is an **API boundary** — it is a NuGet package consumed by third-party extensions. -**Architecture Invariant:** `NuGet.VisualStudio` is a leaf dependency containing only interfaces and simple types. It has no dependency on any other NuGet assembly. This allows third-party extensions to reference it without pulling in the entire NuGet stack. +**Design Rule:** `NuGet.VisualStudio` is a leaf dependency containing only interfaces and simple types. It has no dependency on any other NuGet assembly. This allows third-party extensions to reference it without pulling in the entire NuGet stack. #### `NuGet.VisualStudio.Contracts` Public Service Broker extensibility contracts. Defines `INuGetProjectService` for out-of-process VS extensions to query installed packages. Like `NuGet.VisualStudio`, this is a leaf dependency shipped as a NuGet package. -**Architecture Invariant:** `NuGet.VisualStudio.Contracts` has no internal NuGet dependencies, keeping the public API surface minimal and stable. +**Design Rule:** `NuGet.VisualStudio.Contracts` has no internal NuGet dependencies, keeping the public API surface minimal and stable. #### `NuGet.VisualStudio.Implementation` @@ -290,12 +290,13 @@ The projects form a strict layering. Dependencies flow downward only: │ NuGet.VisualStudio.Common │ │ NuGet.VisualStudio.Implementation │ │ NuGet.VisualStudio.Internal.Contracts │ +│ NuGet.VisualStudio.Interop │ │ NuGet.Indexing │ ├────────────────────┬──────────────────┬─────────────────────┤ │ PUBLIC API │ CLI HOSTS │ MSBUILD HOSTS │ │ NuGet.VisualStudio│ NuGet.exe │ NuGet.Build.Tasks │ │ NuGet.VS.Contracts│ NuGet.XPlat │ NuGet.Build.Pack │ -│ NuGet.VS.Interop │ NuGet.MSSigning │ NuGet.Build.Console│ +│ │ NuGet.MSSigning │ NuGet.Build.Console│ │ │ │ NuGetSdkResolver │ ├────────────────────┴──────────────────┴─────────────────────┤ │ COMMAND LAYER │ @@ -331,7 +332,7 @@ The `build/Shared/` directory contains `.cs` files that are compiled directly in ### Multi-targeting -Core libraries target `net472`, `netstandard2.0`, and modern .NET (currently `net8.0` / `net10.0`). The VS client projects target `net472` only (VS runs on .NET Framework). The XPlat CLI and Build.Tasks.Console target modern .NET only. Target framework constants are defined in `build/config.props`. +Core libraries target `net472` and `net8.0` (defined as `TargetFrameworksLibrary` in `build/common.project.props`). Executable projects (XPlat CLI, Build.Tasks.Console) target `net472` and `net10.0` (`TargetFrameworksExe`). The VS client projects target `net472` only. The sole exception is `NuGet.VisualStudio.Contracts`, which targets `netstandard2.0` for maximum consumer compatibility. ### Central Package Management From 5bb90bb4f6eb3a6ea7210b1b140d3e59eb3f528f Mon Sep 17 00:00:00 2001 From: Arturo Ortiz <58537168+aortiz-msft@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:33:03 -0700 Subject: [PATCH 3/6] Second wave of review feedback --- ARCHITECTURE.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index f49eca51245..179a345490a 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -100,7 +100,7 @@ Depends on: `NuGet.Common`, `NuGet.Frameworks`, `NuGet.Versioning`. #### `NuGet.DependencyResolver.Core` -The graph-based dependency resolution engine for PackageReference projects. Walks the dependency graph using `GraphNode`, resolving version conflicts and computing the transitive closure. The `Remote/` subdirectory handles fetching dependency info from remote feeds. +The **legacy** graph-based dependency resolution engine for PackageReference projects. Walks the dependency graph using `GraphNode`, resolving version conflicts and computing the transitive closure. The `Remote/` subdirectory handles fetching dependency info from remote feeds. **This resolver is being deprecated** in favor of the new `DependencyGraphResolver` class in `NuGet.Commands` (see below). Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. @@ -110,7 +110,7 @@ The dependency resolver for `packages.config` projects. Uses `PackageResolver` w Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. -**Design Rule:** There are two separate resolvers — `NuGet.DependencyResolver.Core` for PackageReference and `NuGet.Resolver` for packages.config. They share the same lower-level libraries but implement fundamentally different resolution strategies. +**Design Rule:** There are three resolvers. `NuGet.DependencyResolver.Core` is the **legacy** PackageReference resolver (being deprecated). `DependencyGraphResolver` in `NuGet.Commands` is its **replacement** — the new dependency resolution engine for PackageReference projects. `NuGet.Resolver` handles packages.config. All three share the same lower-level libraries but implement fundamentally different resolution strategies. #### `NuGet.ProjectModel` @@ -126,7 +126,7 @@ Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Pa #### `NuGet.Commands` -High-level command implementations shared by all clients. `RestoreCommand`, `PackCommand`, `SignCommand`, `VerifyCommand`, `ListPackageCommand`, and others. This is the **API Boundary** between the core logic and the various hosts (CLI, VS, MSBuild). Each host translates its inputs into the command argument types defined here, then delegates to the command runners. +High-level command implementations shared by all clients. `RestoreCommand`, `PackCommand`, `SignCommand`, `VerifyCommand`, `ListPackageCommand`, and others. This is the **API Boundary** between the core logic and the various hosts (CLI, VS, MSBuild). Each host translates its inputs into the command argument types defined here, then delegates to the command runners. Also contains `DependencyGraphResolver` (`RestoreCommand/DependencyGraphResolver.cs`), the **new dependency resolution engine** that is replacing the legacy resolver in `NuGet.DependencyResolver.Core`. Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. @@ -238,15 +238,15 @@ Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.VisualStudio`, ` #### `NuGet.VisualStudio` -The public extensibility API for third-party VS extensions. Defines interfaces like `IVsPackageInstaller`, `IVsPackageUninstaller`, `IVsPackageRestorer`, `IVsFrameworkParser`, and `IVsPathContextProvider`. Also defines the `IVsSolutionRestoreService` interface for restore manager interop. This is an **API boundary** — it is a NuGet package consumed by third-party extensions. +The public extensibility API for third-party VS extensions. Defines interfaces like `IVsPackageInstaller`, `IVsPackageUninstaller`, `IVsPackageRestorer`, `IVsFrameworkParser`, and `IVsPathContextProvider`. Also defines the `IVsSolutionRestoreService` interface for restore manager interop. This is an **API boundary** — it is a NuGet package consumed by third-party extensions. Part of the **NuGet VS SDK** (see [NuGet API in Visual Studio](https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/nuget-api-in-visual-studio)). -**Design Rule:** `NuGet.VisualStudio` is a leaf dependency containing only interfaces and simple types. It has no dependency on any other NuGet assembly. This allows third-party extensions to reference it without pulling in the entire NuGet stack. +**Design Rule:** `NuGet.VisualStudio` is a leaf dependency containing only interfaces and simple types. It has no dependency on any other NuGet assembly. This allows third-party extensions to reference it without pulling in the entire NuGet stack. Because this is a public SDK, any changes to its API surface constitute **breaking changes** and must follow the team's breaking-change process. #### `NuGet.VisualStudio.Contracts` -Public Service Broker extensibility contracts. Defines `INuGetProjectService` for out-of-process VS extensions to query installed packages. Like `NuGet.VisualStudio`, this is a leaf dependency shipped as a NuGet package. +Public Service Broker extensibility contracts. Defines `INuGetProjectService` for out-of-process VS extensions to query installed packages. Like `NuGet.VisualStudio`, this is a leaf dependency shipped as a NuGet package. Part of the **NuGet VS SDK** (see [NuGet API in Visual Studio](https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/nuget-api-in-visual-studio)). -**Design Rule:** `NuGet.VisualStudio.Contracts` has no internal NuGet dependencies, keeping the public API surface minimal and stable. +**Design Rule:** `NuGet.VisualStudio.Contracts` has no internal NuGet dependencies, keeping the public API surface minimal and stable. As with `NuGet.VisualStudio`, any API changes here are **breaking changes** and must follow the team's breaking-change process. #### `NuGet.VisualStudio.Implementation` @@ -301,12 +301,13 @@ The projects form a strict layering. Dependencies flow downward only: ├────────────────────┴──────────────────┴─────────────────────┤ │ COMMAND LAYER │ │ NuGet.Commands (restore, pack, sign, verify, list, ...) │ +│ └─ DependencyGraphResolver (new PackageReference resolver)│ │ NuGet.PackageManagement (install, update, uninstall) │ │ NuGet.Credentials │ ├─────────────────────────────────────────────────────────────┤ │ DATA MODEL LAYER │ │ NuGet.ProjectModel (PackageSpec, LockFile, DependencyGraph)│ -│ NuGet.DependencyResolver.Core (graph-based resolution) │ +│ NuGet.DependencyResolver.Core (legacy resolution, deprecated)│ │ NuGet.Resolver (packages.config resolution) │ ├─────────────────────────────────────────────────────────────┤ │ PROTOCOL LAYER │ @@ -352,7 +353,9 @@ NuGet exposes two VS extensibility surfaces: - **In-process (MEF):** `NuGet.VisualStudio` interfaces (`IVsPackageInstaller`, etc.) — consumed by third-party extensions loading in the same VS process. - **Out-of-process (Service Broker):** `NuGet.VisualStudio.Contracts` (`INuGetProjectService`) — consumed by extensions that may run out-of-process. -Both are leaf assemblies with no internal NuGet dependencies, ensuring a stable public API surface. +Together these two packages form the **NuGet VS SDK** ([docs](https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/nuget-api-in-visual-studio)). Both are leaf assemblies with no internal NuGet dependencies, ensuring a stable public API surface. + +**Design Rule:** Any changes to the APIs in `NuGet.VisualStudio` or `NuGet.VisualStudio.Contracts` are **breaking changes** for external consumers and must follow the team's breaking-change process. Treat these two assemblies with extreme care during code reviews. ### Build System From d3ca51ddbc5c506f9d8e4355ba4eefa0df932df1 Mon Sep 17 00:00:00 2001 From: Arturo Ortiz <58537168+aortiz-msft@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:42:46 -0700 Subject: [PATCH 4/6] Replaced ASCII diagram with Mermaid diagram --- ARCHITECTURE.md | 203 +++++++++++++++++++++++++++++------------------- 1 file changed, 121 insertions(+), 82 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 179a345490a..377a8202aec 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -58,27 +58,27 @@ The dependency graph flows strictly downward: Visual Studio client code depends These are the foundational libraries shared by all NuGet products. They are multi-targeted (`net472` and `net8.0`) and have no dependency on Visual Studio or any specific host. -#### `NuGet.Versioning` +#### [`NuGet.Versioning`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj) NuGet's implementation of Semantic Versioning. Defines `NuGetVersion`, `SemanticVersion`, `VersionRange`, `FloatRange`, and version comparison/formatting logic. This is a leaf dependency — it depends on nothing else in the repo. -#### `NuGet.Frameworks` +#### [`NuGet.Frameworks`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj) NuGet's understanding of .NET target frameworks. Defines `NuGetFramework`, `CompatibilityProvider`, `FrameworkReducer`, and framework name mappings. Another leaf dependency. The `def/` subdirectory contains the built-in framework compatibility definitions. **Design Rule:** `NuGet.Versioning` and `NuGet.Frameworks` are leaf libraries with zero internal dependencies. They are usable in isolation. -#### `NuGet.Common` +#### [`NuGet.Common`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Common/NuGet.Common.csproj) Shared utilities, logging infrastructure (`ILogger`), telemetry, error types, and cross-cutting helpers. Depends only on `NuGet.Frameworks`. -#### `NuGet.Configuration` +#### [`NuGet.Configuration`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj) Reads and writes NuGet configuration (`NuGet.Config` files). Defines `PackageSource`, `ISettings`, credential storage, proxy configuration, client certificates, and package source mapping. The `Settings/` subdirectory contains the XML read/write logic. Depends on: `NuGet.Common`, `NuGet.Frameworks`. -#### `NuGet.Packaging` +#### [`NuGet.Packaging`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/NuGet.Packaging.csproj) NuGet's understanding of `.nupkg` files and `.nuspec` metadata. Provides `PackageArchiveReader`, `NuspecReader`, `PackagesConfigReader`, `PackageExtractor`, content model resolution, and the complete package signing infrastructure (in `Signing/`). Also defines the `NuGet.Packaging.Core` types such as `PackageIdentity` and `PackageDependency`. @@ -86,25 +86,25 @@ Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Ve **Design Rule:** `NuGet.Packaging` knows how to read and write packages but knows nothing about where they come from (feeds, caches). Feed interaction is handled by `NuGet.Protocol`. -#### `NuGet.Protocol` +#### [`NuGet.Protocol`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Protocol/NuGet.Protocol.csproj) Implements communication with NuGet feeds — both the legacy V2 (OData) protocol and the modern V3 (JSON-based) service index protocol. Defines `SourceRepository`, resource providers, HTTP source handling, local folder repositories, and the plugin credential/download system (in `Plugins/`). The `SourceCacheContext` controls HTTP caching behavior. Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Versioning`. -#### `NuGet.LibraryModel` +#### [`NuGet.LibraryModel`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.LibraryModel/NuGet.LibraryModel.csproj) Data model for library/package dependencies. Defines `LibraryRange`, `LibraryIdentity`, `LibraryDependency`, `LibraryType`, and `FrameworkDependency`. These are the types used by the dependency resolver to describe what a project needs. Depends on: `NuGet.Common`, `NuGet.Frameworks`, `NuGet.Versioning`. -#### `NuGet.DependencyResolver.Core` +#### [`NuGet.DependencyResolver.Core`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.DependencyResolver.Core/NuGet.DependencyResolver.Core.csproj) The **legacy** graph-based dependency resolution engine for PackageReference projects. Walks the dependency graph using `GraphNode`, resolving version conflicts and computing the transitive closure. The `Remote/` subdirectory handles fetching dependency info from remote feeds. **This resolver is being deprecated** in favor of the new `DependencyGraphResolver` class in `NuGet.Commands` (see below). Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. -#### `NuGet.Resolver` +#### [`NuGet.Resolver`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Resolver/NuGet.Resolver.csproj) The dependency resolver for `packages.config` projects. Uses `PackageResolver` with a different algorithm than the PackageReference resolver. This is the older resolution strategy. @@ -112,19 +112,19 @@ Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Pa **Design Rule:** There are three resolvers. `NuGet.DependencyResolver.Core` is the **legacy** PackageReference resolver (being deprecated). `DependencyGraphResolver` in `NuGet.Commands` is its **replacement** — the new dependency resolution engine for PackageReference projects. `NuGet.Resolver` handles packages.config. All three share the same lower-level libraries but implement fundamentally different resolution strategies. -#### `NuGet.ProjectModel` +#### [`NuGet.ProjectModel`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.ProjectModel/NuGet.ProjectModel.csproj) Defines the data model for PackageReference-based restore: `PackageSpec` (the in-memory representation of a project's NuGet configuration), `DependencyGraphSpec` (the complete restore input graph), `LockFile` / `LockFileFormat` (the `project.assets.json` output), and `ProjectRestoreMetadata`. Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. -#### `NuGet.Credentials` +#### [`NuGet.Credentials`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Credentials/NuGet.Credentials.csproj) Credential provider infrastructure. Defines `ICredentialProvider`, `CredentialService`, and the plugin-based credential provider model. Handles authentication handshakes with feeds. Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Frameworks`, `NuGet.Packaging`, `NuGet.Protocol`, `NuGet.Versioning`. -#### `NuGet.Commands` +#### [`NuGet.Commands`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/NuGet.Commands.csproj) High-level command implementations shared by all clients. `RestoreCommand`, `PackCommand`, `SignCommand`, `VerifyCommand`, `ListPackageCommand`, and others. This is the **API Boundary** between the core logic and the various hosts (CLI, VS, MSBuild). Each host translates its inputs into the command argument types defined here, then delegates to the command runners. Also contains `DependencyGraphResolver` (`RestoreCommand/DependencyGraphResolver.cs`), the **new dependency resolution engine** that is replacing the legacy resolver in `NuGet.DependencyResolver.Core`. @@ -132,19 +132,19 @@ Depends on: `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.D **Design Rule:** `NuGet.Commands` is the **primary API boundary**. It contains the shared business logic for operations like restore, pack, and sign. The CLI executables, MSBuild tasks, and VS extension all call into this layer. Nothing in `NuGet.Commands` knows about MSBuild, Visual Studio, or any specific CLI framework. -#### `NuGet.PackageManagement` +#### [`NuGet.PackageManagement`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj) Package management orchestration for install/uninstall/update flows (primarily used by the Visual Studio client and NuGet.exe `install`/`update` commands). Defines `NuGetPackageManager`, the abstract `NuGetProject` base class, and concrete project types like `MSBuildNuGetProject`, `FolderNuGetProject`, and `BuildIntegratedNuGetProject`. The `Audit/` subdirectory handles package vulnerability auditing. Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.DependencyResolver.Core`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Resolver`, `NuGet.Versioning`. -#### `NuGet.Localization` +#### [`NuGet.Localization`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Localization/NuGet.Localization.csproj) Localization satellite assemblies for the dotnet CLI. Leaf dependency. ### MSBuild Integration (`src/NuGet.Core/`) -#### `NuGet.Build.Tasks` +#### [`NuGet.Build.Tasks`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Build.Tasks/NuGet.Build.Tasks.csproj) MSBuild tasks and targets that implement `dotnet restore` and `msbuild /t:Restore`. The `RestoreTask` class delegates to `RestoreCommand` from `NuGet.Commands`. Ships the `NuGet.targets` and `NuGet.props` files that are imported by the .NET SDK into every project. @@ -152,19 +152,19 @@ Also contains the `NuGet.RestoreEx.targets` file used for static graph restore, Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.PackageManagement`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. -#### `NuGet.Build.Tasks.Console` +#### [`NuGet.Build.Tasks.Console`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Build.Tasks.Console/NuGet.Build.Tasks.Console.csproj) A standalone console executable (`NuGet.Build.Tasks.Console.exe`) that runs restore using MSBuild's static graph functionality. This is the out-of-process restore host invoked by the `RestoreTaskEx` MSBuild task for improved performance. Depends on: `NuGet.Build.Tasks` and all transitive core libraries. -#### `NuGet.Build.Tasks.Pack` +#### [`NuGet.Build.Tasks.Pack`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj) MSBuild tasks and targets for `dotnet pack`. The `PackTask` class creates `.nupkg` files from project metadata. Ships the `NuGet.Build.Tasks.Pack.targets` file. Supports multi-targeted projects and symbol packages. Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Credentials`, `NuGet.Frameworks`, `NuGet.LibraryModel`, `NuGet.Packaging`, `NuGet.ProjectModel`, `NuGet.Protocol`, `NuGet.Versioning`. -#### `Microsoft.Build.NuGetSdkResolver` +#### [`Microsoft.Build.NuGetSdkResolver`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/Microsoft.Build.NuGetSdkResolver.csproj) An MSBuild SDK resolver (priority 6000) that resolves MSBuild SDKs distributed as NuGet packages. Reads the `msbuild-sdks` section from `global.json` and performs a NuGet restore to obtain the SDK package. Can be disabled via the `MSBUILDDISABLENUGETSDKRESOLVER` environment variable. Avoids loading NuGet assemblies unless an SDK actually needs resolution. @@ -172,7 +172,7 @@ Depends on: `NuGet.Commands`, `NuGet.Common`, `NuGet.Configuration`, `NuGet.Cred ### Command-Line Tools -#### `NuGet.CommandLine` (`src/NuGet.Clients/`) +#### [`NuGet.CommandLine`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj) (`src/NuGet.Clients/`) The `NuGet.exe` console application. Targets .NET Framework 4.7.2 only. Uses **ILRepack** to merge all dependent assemblies into a single self-contained executable. Commands are discovered via MEF (`[Export]` attributes on `ICommand` implementations), and third-party extensions can be loaded from configurable extension directories. @@ -182,7 +182,7 @@ Depends on: `NuGet.Build.Tasks`, `NuGet.Commands`, `NuGet.PackageManagement`, an **Design Rule:** `NuGet.CommandLine` is .NET Framework only. It is the legacy CLI tool. The cross-platform equivalent is `NuGet.CommandLine.XPlat`. -#### `NuGet.CommandLine.XPlat` (`src/NuGet.Core/`) +#### [`NuGet.CommandLine.XPlat`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj) (`src/NuGet.Core/`) The cross-platform CLI that powers `dotnet nuget` commands. Integrated into the .NET SDK — the SDK calls `NuGetCommands.Add(RootCommand, ...)` to register NuGet's commands into the `dotnet` command tree. Uses a mix of `System.CommandLine` (newer commands like `config`, `why`, `package search`) and `Microsoft.Extensions.CommandLineUtils` (older commands like `delete`, `push`, `locals`). @@ -194,7 +194,7 @@ Depends on: `NuGet.Commands` (and transitive core libraries). The VS extension is packaged as a VSIX (`NuGet.VisualStudio.Client`) and ships as a system component of Visual Studio. It registers two `AsyncPackage` classes, exposes functionality via MEF exports, and provides brokered services for out-of-process access. -#### `NuGet.Tools` +#### [`NuGet.Tools`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.Tools/NuGet.Tools.csproj) The main Visual Studio package. `NuGetPackage` (inherits `AsyncPackage`) registers menu commands, tool windows, settings pages, brokered services, and the NuGet search provider. It is the entry point that wires together the Package Manager UI, the PowerShell Console, and all NuGet services within VS. @@ -202,7 +202,7 @@ Key responsibilities: launches the Package Manager dialog (project-level and sol Depends on: nearly all other NuGet.Clients projects plus core libraries. -#### `NuGet.SolutionRestoreManager` +#### [`NuGet.SolutionRestoreManager`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.SolutionRestoreManager/NuGet.SolutionRestoreManager.csproj) The second VS package. `RestoreManagerPackage` auto-loads when a solution is open and hooks into VS build events. `SolutionRestoreBuildHandler` triggers restore before build. `SolutionRestoreWorker` executes restore jobs. `VsSolutionRestoreService` exposes restore as a brokered service. @@ -210,65 +210,65 @@ Also provides the `AuditCheckResultCachingService` for vulnerability checks and Depends on: `NuGet.PackageManagement.VisualStudio`, `NuGet.VisualStudio.Common`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. -#### `NuGet.PackageManagement.UI` +#### [`NuGet.PackageManagement.UI`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.PackageManagement.UI/NuGet.PackageManagement.UI.csproj) WPF-based Package Manager dialog. `PackageManagerControl` is the main UI control. `NuGetUIFactory` creates UI contexts. `PackageItemLoader` handles lazy-loading with infinite scroll. The UI communicates with the core through brokered service proxies defined in `NuGet.VisualStudio.Internal.Contracts`. Depends on: `NuGet.PackageManagement.VisualStudio`, `NuGet.Indexing`, `NuGet.VisualStudio.Common`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. -#### `NuGet.Console` +#### [`NuGet.Console`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.Console/NuGet.Console.csproj) The PowerShell Package Manager Console. `PowerConsoleToolWindow` hosts a WPF-based terminal. `WpfConsoleService` manages the console output. Provides IntelliSense via `CompletionSourceProvider` and syntax highlighting via `ClassifierProvider`. -#### `NuGet.PackageManagement.PowerShellCmdlets` +#### [`NuGet.PackageManagement.PowerShellCmdlets`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.PackageManagement.PowerShellCmdlets/NuGet.PackageManagement.PowerShellCmdlets.csproj) PowerShell cmdlet implementations (`Install-Package`, `Update-Package`, `Uninstall-Package`, `Get-Package`, etc.) that run within the Package Manager Console. These cmdlets call into `NuGet.PackageManagement` for the actual operations. -#### `NuGet.PackageManagement.VisualStudio` +#### [`NuGet.PackageManagement.VisualStudio`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/NuGet.PackageManagement.VisualStudio.csproj) VS-specific package management infrastructure. `VSSolutionManager` tracks the loaded solution and projects. Provides project system adapters (`CpsPackageReferenceProjectProvider`, `LegacyPackageReferenceProjectProvider`, `MSBuildNuGetProjectProvider`) that bridge the VS project system to `NuGetProject` types in `NuGet.PackageManagement`. Also handles VS credentials, settings, and source control integration. Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.Indexing`, `NuGet.VisualStudio.Common`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. -#### `NuGet.VisualStudio.Common` +#### [`NuGet.VisualStudio.Common`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio.Common/NuGet.VisualStudio.Common.csproj) Shared infrastructure used by all VS client projects. Contains telemetry (`NuGetTelemetryProvider`), experimentation/A/B testing (`NuGetExperimentationService`), the error list integration, output window logging, and the `ServiceLocator` that provides static access to MEF-composed services. Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.VisualStudio`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries. -#### `NuGet.VisualStudio` +#### [`NuGet.VisualStudio`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio/NuGet.VisualStudio.csproj) The public extensibility API for third-party VS extensions. Defines interfaces like `IVsPackageInstaller`, `IVsPackageUninstaller`, `IVsPackageRestorer`, `IVsFrameworkParser`, and `IVsPathContextProvider`. Also defines the `IVsSolutionRestoreService` interface for restore manager interop. This is an **API boundary** — it is a NuGet package consumed by third-party extensions. Part of the **NuGet VS SDK** (see [NuGet API in Visual Studio](https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/nuget-api-in-visual-studio)). **Design Rule:** `NuGet.VisualStudio` is a leaf dependency containing only interfaces and simple types. It has no dependency on any other NuGet assembly. This allows third-party extensions to reference it without pulling in the entire NuGet stack. Because this is a public SDK, any changes to its API surface constitute **breaking changes** and must follow the team's breaking-change process. -#### `NuGet.VisualStudio.Contracts` +#### [`NuGet.VisualStudio.Contracts`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio.Contracts/NuGet.VisualStudio.Contracts.csproj) Public Service Broker extensibility contracts. Defines `INuGetProjectService` for out-of-process VS extensions to query installed packages. Like `NuGet.VisualStudio`, this is a leaf dependency shipped as a NuGet package. Part of the **NuGet VS SDK** (see [NuGet API in Visual Studio](https://learn.microsoft.com/en-us/nuget/visual-studio-extensibility/nuget-api-in-visual-studio)). **Design Rule:** `NuGet.VisualStudio.Contracts` has no internal NuGet dependencies, keeping the public API surface minimal and stable. As with `NuGet.VisualStudio`, any API changes here are **breaking changes** and must follow the team's breaking-change process. -#### `NuGet.VisualStudio.Implementation` +#### [`NuGet.VisualStudio.Implementation`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio.Implementation/NuGet.VisualStudio.Implementation.csproj) Implements the extensibility interfaces from `NuGet.VisualStudio`. `VsPackageInstaller`, `VsPackageRestorer`, `VsPackageUninstaller`, `VsFrameworkParser`, `VsPathContextProvider` are all MEF exports. Also provides the Solution Explorer integration (`PackageReferenceAttachedCollectionSourceProvider`) and template wizard support (`VsTemplateWizard`). -#### `NuGet.VisualStudio.Internal.Contracts` +#### [`NuGet.VisualStudio.Internal.Contracts`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio.Internal.Contracts/NuGet.VisualStudio.Internal.Contracts.csproj) Internal service contracts for brokered service communication within VS. Defines `INuGetSolutionManagerService`, `INuGetProjectManagerService`, `INuGetSearchService`, `INuGetSourcesService`, and `INuGetProjectUpgraderService`. These are not part of the public API. Uses MessagePack serialization for RPC. -#### `NuGet.VisualStudio.Interop` +#### [`NuGet.VisualStudio.Interop`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio.Interop/NuGet.VisualStudio.Interop.csproj) COM interop assembly for the VS template wizard. Bridges `NuGet.VisualStudio.Implementation` template wizard to VS via COM. Depends only on `NuGet.VisualStudio`. -#### `NuGet.VisualStudio.Client` +#### [`NuGet.VisualStudio.Client`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio.Client/NuGet.VisualStudio.Client.csproj) The VSIX project that packages the entire VS extension. Contains the `source.extension.vsixmanifest` that declares all VS packages, MEF components, and bundled assemblies. This is not a code project — it is the packaging and deployment artifact. -#### `NuGet.Indexing` +#### [`NuGet.Indexing`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.Indexing/NuGet.Indexing.csproj) Package search indexing and result aggregation for the VS Package Manager UI. Uses Lucene.Net for relevance ranking and `SearchResultsAggregator` to merge results from multiple feeds. -#### `NuGet.MSSigning.Extensions` +#### [`NuGet.MSSigning.Extensions`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.MSSigning.Extensions/NuGet.MSSigning.Extensions.csproj) Extension commands for repository signing (`NuGet.exe reposign`, `NuGet.exe sign`). Extends `NuGet.CommandLine` with additional signing functionality. @@ -276,53 +276,92 @@ Extension commands for repository signing (`NuGet.exe reposign`, `NuGet.exe sign The projects form a strict layering. Dependencies flow downward only: -``` -┌─────────────────────────────────────────────────────────────┐ -│ VISUAL STUDIO HOST │ -│ NuGet.VisualStudio.Client (VSIX packaging) │ -│ NuGet.Tools (main VS package) │ -│ NuGet.SolutionRestoreManager (restore VS package) │ -│ NuGet.Console, NuGet.PackageManagement.PowerShellCmdlets │ -│ NuGet.PackageManagement.UI │ -├─────────────────────────────────────────────────────────────┤ -│ VS INTEGRATION LAYER │ -│ NuGet.PackageManagement.VisualStudio │ -│ NuGet.VisualStudio.Common │ -│ NuGet.VisualStudio.Implementation │ -│ NuGet.VisualStudio.Internal.Contracts │ -│ NuGet.VisualStudio.Interop │ -│ NuGet.Indexing │ -├────────────────────┬──────────────────┬─────────────────────┤ -│ PUBLIC API │ CLI HOSTS │ MSBUILD HOSTS │ -│ NuGet.VisualStudio│ NuGet.exe │ NuGet.Build.Tasks │ -│ NuGet.VS.Contracts│ NuGet.XPlat │ NuGet.Build.Pack │ -│ │ NuGet.MSSigning │ NuGet.Build.Console│ -│ │ │ NuGetSdkResolver │ -├────────────────────┴──────────────────┴─────────────────────┤ -│ COMMAND LAYER │ -│ NuGet.Commands (restore, pack, sign, verify, list, ...) │ -│ └─ DependencyGraphResolver (new PackageReference resolver)│ -│ NuGet.PackageManagement (install, update, uninstall) │ -│ NuGet.Credentials │ -├─────────────────────────────────────────────────────────────┤ -│ DATA MODEL LAYER │ -│ NuGet.ProjectModel (PackageSpec, LockFile, DependencyGraph)│ -│ NuGet.DependencyResolver.Core (legacy resolution, deprecated)│ -│ NuGet.Resolver (packages.config resolution) │ -├─────────────────────────────────────────────────────────────┤ -│ PROTOCOL LAYER │ -│ NuGet.Protocol (V2/V3 feeds, HTTP, local, plugins) │ -├─────────────────────────────────────────────────────────────┤ -│ CORE MODEL LAYER │ -│ NuGet.Packaging (nupkg, nuspec, signing, content model) │ -│ NuGet.LibraryModel (dependency types) │ -│ NuGet.Configuration (NuGet.Config, package sources) │ -│ NuGet.Common (logging, utilities) │ -├─────────────────────────────────────────────────────────────┤ -│ FOUNDATION LAYER │ -│ NuGet.Frameworks (target framework parsing/compatibility) │ -│ NuGet.Versioning (semantic version parsing/comparison) │ -└─────────────────────────────────────────────────────────────┘ +```mermaid +block-beta + columns 3 + + block:vshost:3 + columns 3 + vs_header["VISUAL STUDIO HOST"]:3 + vs1["NuGet.VisualStudio.Client\n(VSIX packaging)"] + vs2["NuGet.Tools\nNuGet.SolutionRestoreManager"] + vs3["NuGet.Console\nNuGet.PackageManagement.UI\nNuGet.PM.PowerShellCmdlets"] + end + + block:vsintegration:3 + columns 2 + vsi_header["VS INTEGRATION LAYER"]:2 + vsi1["NuGet.PackageManagement.VisualStudio\nNuGet.VisualStudio.Common\nNuGet.VisualStudio.Implementation"] + vsi2["NuGet.VisualStudio.Internal.Contracts\nNuGet.VisualStudio.Interop\nNuGet.Indexing"] + end + + block:publicapi + columns 1 + pa_header["PUBLIC API\n(NuGet VS SDK)"] + pa1["NuGet.VisualStudio\nNuGet.VisualStudio.Contracts"] + end + block:cli + columns 1 + cli_header["CLI HOSTS"] + cli1["NuGet.CommandLine\nNuGet.CommandLine.XPlat\nNuGet.MSSigning.Extensions"] + end + block:msbuild + columns 1 + msb_header["MSBUILD HOSTS"] + msb1["NuGet.Build.Tasks\nNuGet.Build.Tasks.Pack\nNuGet.Build.Tasks.Console\nMicrosoft.Build.NuGetSdkResolver"] + end + + block:commands:3 + columns 1 + cmd_header["COMMAND LAYER"] + cmd1["NuGet.Commands (restore, pack, sign, verify, list, ...)\n⤷ DependencyGraphResolver (new PackageReference resolver)\nNuGet.PackageManagement · NuGet.Credentials"] + end + + block:datamodel:3 + columns 1 + dm_header["DATA MODEL LAYER"] + dm1["NuGet.ProjectModel\nNuGet.DependencyResolver.Core ⚠️ legacy, deprecated\nNuGet.Resolver (packages.config)"] + end + + block:protocol:3 + columns 1 + pr_header["PROTOCOL LAYER"] + pr1["NuGet.Protocol (V2/V3 feeds, HTTP, local, plugins)"] + end + + block:coremodel:3 + columns 1 + cm_header["CORE MODEL LAYER"] + cm1["NuGet.Packaging · NuGet.LibraryModel\nNuGet.Configuration · NuGet.Common"] + end + + block:foundation:3 + columns 1 + fn_header["FOUNDATION LAYER"] + fn1["NuGet.Frameworks · NuGet.Versioning"] + end + + vshost --> vsintegration + vsintegration --> publicapi + vsintegration --> commands + publicapi --> commands + cli --> commands + msbuild --> commands + commands --> datamodel + datamodel --> protocol + protocol --> coremodel + coremodel --> foundation + + style vs_header fill:transparent,stroke:none + style vsi_header fill:transparent,stroke:none + style pa_header fill:transparent,stroke:none + style cli_header fill:transparent,stroke:none + style msb_header fill:transparent,stroke:none + style cmd_header fill:transparent,stroke:none + style dm_header fill:transparent,stroke:none + style pr_header fill:transparent,stroke:none + style cm_header fill:transparent,stroke:none + style fn_header fill:transparent,stroke:none ``` ## Cross-Cutting Concerns From d6aea68abc74f9a425d586adcc22508c14504360 Mon Sep 17 00:00:00 2001 From: Arturo Ortiz <58537168+aortiz-msft@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:52:17 -0700 Subject: [PATCH 5/6] Add skill for generating the architecture.md file --- .../architecture-doc-generator/SKILL.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 .github/skills/architecture-doc-generator/SKILL.md diff --git a/.github/skills/architecture-doc-generator/SKILL.md b/.github/skills/architecture-doc-generator/SKILL.md new file mode 100644 index 00000000000..ac3f7867e09 --- /dev/null +++ b/.github/skills/architecture-doc-generator/SKILL.md @@ -0,0 +1,145 @@ +--- +name: architecture-doc-generator +description: Generates an ARCHITECTURE.md file for a repository following matklad's guidelines. Use this when asked to create, generate, or regenerate an architecture document for a codebase. +--- + +# Architecture Document Generator + +Generate an `ARCHITECTURE.md` file for a repository following the conventions described in +[matklad's ARCHITECTURE.md blog post](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html) +and modeled after the +[rust-analyzer architecture doc](https://github.com/rust-analyzer/rust-analyzer/blob/d7c99931d05e3723d878bea5dc26766791fa4e69/docs/dev/architecture.md). + +## Document Structure + +The generated file MUST follow this structure, in order: + +1. **Title and introduction** — A short paragraph explaining what the document is and who it is for. +2. **Bird's Eye View** — A high-level overview of the problem being solved and the products/artifacts the repository ships. Keep it to a few paragraphs. +3. **Repository Layout** — A `tree`-style overview of the top-level directory structure, plus any solution filters, workspaces, or other mechanisms for loading subsets of the code. +4. **Code Map** — The heart of the document. Describes each significant project/crate/package: what it does, what it depends on, and any design rules it enforces. Organized by architectural layer (foundation → core → commands → hosts → UI). +5. **Dependency Layers** — A Mermaid `block-beta` diagram showing the strict layering of the codebase. Dependencies flow downward only. Use ```` ```mermaid ```` fenced code blocks so GitHub renders the diagram natively. See the Mermaid diagram guidelines below. +6. **Cross-Cutting Concerns** — Shared source files, multi-targeting, build system, extensibility models, testing strategy, and other concerns that span multiple projects. + +## Writing Guidelines + +### What to include +- Name important files, modules, and types so readers can use symbol search to find them. +- Describe coarse-grained modules and how they relate to each other. +- Call out **API boundaries** — the interfaces where one subsystem meets another. +- Call out **Design Rules** (see below). +- Mention the dependency direction between layers. +- **Project heading links**: Each project heading in the Code Map MUST link to its project file (e.g., `.csproj`, `Cargo.toml`, `package.json`) on the repository's hosting platform. Generate the URL by prepending the repository's web base URL to the project file's relative path. Use forward slashes in URLs regardless of the local OS. Format: `#### [\`ProjectName\`](https://github.com/org/repo/blob/main/path/to/Project.csproj)`. To get the relative paths, enumerate the actual project files from the local clone — do not guess paths. + +### What to exclude +- Do NOT go into detail about *how* each module works internally. The code map is a map of a country, not an atlas of maps of its states. +- Do NOT mention implementation-level interface names (e.g., `ICancelableTask`, `IDisposable`) unless they are part of the public API surface. Focus on *what* a component does, not which .NET interfaces it implements. +- Do NOT mention features that are not ready for public consumption, even if they exist in the code. When in doubt, omit. +- Do NOT include time estimates or dates. + +### Design Rules +Use the label **"Design Rule:"** (bold) for important constraints the codebase deliberately maintains. These are the successor to what matklad calls "Architecture Invariants" — we prefer the name "Design Rule" because it is clearer and more actionable. + +Design Rules are most valuable when they describe something that is **absent** from the code — a dependency that deliberately does not exist, a concern that a layer intentionally ignores. They are hard to discover by reading code alone. + +Format them as standalone bold-prefixed paragraphs within the relevant code map section: + +```markdown +**Design Rule:** `NuGet.Commands` knows nothing about MSBuild, Visual Studio, or any specific CLI framework. It is the shared business logic boundary. +``` + +### Accuracy Requirements +- **Target frameworks**: Always read the actual build configuration files (e.g., `Directory.Build.props`, `common.project.props`, `Cargo.toml`, `tsconfig.json`) to determine real target frameworks. Never guess or assume — the explore agent's summaries may hallucinate these. +- **Dependency graph**: If a DGML code map or similar artifact is provided, parse it programmatically (e.g., with a Node.js script) to extract the real dependency relationships. Do not rely solely on agent summaries for dependency data. +- **Public vs. internal**: Carefully distinguish public API surfaces (shipped as packages for third-party consumption) from internal implementation details. Do not list internal components under "Public API" headings or diagram sections. +- **MSBuild / build system details**: When describing build tasks, attribute functionality to the correct system (e.g., "uses MSBuild's static graph APIs" not "evaluates the project graph up-front"). + +### Mermaid Diagram Guidelines + +Use Mermaid `block-beta` diagrams for the Dependency Layers section. These render natively on GitHub when placed inside ```` ```mermaid ```` fenced code blocks. Do NOT use ASCII art. + +**Layout rules:** +- Use `columns 3` (or as appropriate) at the top level to allow side-by-side blocks for parallel host layers (e.g., Public API | CLI Hosts | MSBuild Hosts). +- Full-width layers (e.g., Command Layer, Protocol Layer) span all columns with `:3` syntax: `block:commands:3`. +- Each block contains a header node (styled transparent) and content nodes listing the projects in that layer. +- Use `\n` for line breaks within node labels to list multiple projects per node. +- Use `·` (middle dot) to separate items on the same line when space is tight. + +**Arrows and flow:** +- Add downward arrows (`-->`) between layer blocks to show the dependency flow direction. +- Only show layer-to-layer edges, not individual project-to-project edges — the diagram is about coarse-grained layers. + +**Styling:** +- Style header nodes with `fill:transparent,stroke:none` so they appear as plain text labels rather than boxes. +- Use emoji annotations sparingly for important callouts (e.g., `⚠️` for deprecated components, `⤷` for sub-components). + +**Example skeleton:** +``` +block-beta + columns 3 + + block:top_layer:3 + columns 1 + top_header["LAYER NAME"] + top1["Project.A · Project.B"] + end + + block:left_col + lc_header["LEFT"] + lc1["Project.C"] + end + block:middle_col + mc_header["MIDDLE"] + mc1["Project.D"] + end + block:right_col + rc_header["RIGHT"] + rc1["Project.E"] + end + + block:bottom_layer:3 + columns 1 + bl_header["BOTTOM LAYER"] + bl1["Project.F · Project.G"] + end + + top_layer --> left_col + top_layer --> middle_col + top_layer --> right_col + left_col --> bottom_layer + middle_col --> bottom_layer + right_col --> bottom_layer + + style top_header fill:transparent,stroke:none + style lc_header fill:transparent,stroke:none + style mc_header fill:transparent,stroke:none + style rc_header fill:transparent,stroke:none + style bl_header fill:transparent,stroke:none +``` + +## Process + +When generating the architecture document: + +1. **Request a DGML code map** — Before doing any work, ask the user to provide a DGML file for the repository. This file is essential for extracting accurate dependency relationships between projects. The user must generate it in Visual Studio by following the instructions at: https://learn.microsoft.com/en-us/visualstudio/modeling/analyze-and-model-your-architecture?view=visualstudio#dependency-diagrams. Do NOT proceed without this file. +2. **Explore the repository** — Read the top-level directory structure, solution/workspace files, build configuration, and any existing documentation (README, docs/ folder). +3. **Identify the products** — Determine the distinct artifacts the repo ships (executables, libraries, extensions, packages). Ask the user to describe the products if it is not obvious. +4. **Map the projects** — For each project/crate/package, read its build file to understand target frameworks, dependencies, and purpose. Read key source files to understand entry points and major types. +5. **Extract dependencies** — Parse the DGML file programmatically (e.g., with a Node.js script) to extract the real internal dependency graph. Do not rely on agent summaries for dependency data. +6. **Verify claims** — Cross-check target frameworks, dependency directions, and public/internal classifications against the actual source. Do not trust agent summaries blindly. +7. **Write the document** — Follow the structure and guidelines above. Keep it concise — every recurring contributor will have to read it. +8. **Review with the user** — The document will likely need domain-specific corrections. Be prepared to iterate. + +## Reference + +The current `ARCHITECTURE.md` for NuGet.Client at `Q:\src\Nuget.Client\ARCHITECTURE.md` is an example of the output this skill produces. Use it as a reference for tone, structure, and level of detail. + +## Domain-Specific Patterns to Document + +When generating architecture docs, watch for these patterns and document them with Design Rules: + +### Deprecation / migration of subsystems +If a component is being replaced by a newer implementation, clearly mark the old one as **legacy/deprecated** and point to the replacement. Both the old component's section and the new component's section should cross-reference each other, and any summary diagrams should reflect the deprecation. Example: a legacy dependency resolver in one library being superseded by a new resolver class in a higher-level command library. + +### Public SDK / extensibility API boundaries +If certain assemblies form a **public SDK** consumed by third-party developers, call this out explicitly. Link to the official documentation for the SDK. Add a Design Rule noting that any changes to these APIs constitute **breaking changes** and must follow the team's breaking-change process. These assemblies deserve extra scrutiny during code review. From a1343313347bd6036d182fa16cf67e902dd5e078 Mon Sep 17 00:00:00 2001 From: Arturo Ortiz <58537168+aortiz-msft@users.noreply.github.com> Date: Wed, 25 Mar 2026 14:52:58 -0700 Subject: [PATCH 6/6] Delete project-overview.md file --- docs/project-overview.md | 130 --------------------------------------- 1 file changed, 130 deletions(-) delete mode 100644 docs/project-overview.md diff --git a/docs/project-overview.md b/docs/project-overview.md deleted file mode 100644 index 998794e25ab..00000000000 --- a/docs/project-overview.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -date-generated: 2025-05-21T13:24:04 -tool: NuGetTasks.GenerateMarkdownDoc ---- - - -# NuGet Project Overview - -Below is a list of projects contained in the NuGet.Client repo, organized by product and test projects. - -## Product Projects - -All shipped NuGet libraries and clients in `src/` folder. - -Projects in section: 35 - -### src\NuGet.Clients - -- [`NuGet.CommandLine.csproj`](../src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj): NuGet Command Line Interface. -- [`NuGet.Console.csproj`](../src/NuGet.Clients/NuGet.Console/NuGet.Console.csproj): Package Manager PowerShell Console implementation. -- [`NuGet.Indexing.csproj`](../src/NuGet.Clients/NuGet.Indexing/NuGet.Indexing.csproj): NuGet's indexing library for the Visual Studio client search functionality. -- [`NuGet.MSSigning.Extensions.csproj`](../src/NuGet.Clients/NuGet.MSSigning.Extensions/NuGet.MSSigning.Extensions.csproj): NuGet Command Line Interface for repository signing. -- [`NuGet.PackageManagement.PowerShellCmdlets.csproj`](../src/NuGet.Clients/NuGet.PackageManagement.PowerShellCmdlets/NuGet.PackageManagement.PowerShellCmdlets.csproj): Package Manager Console PowerShell host implementation and NuGet's PowerShell cmdlets for the Visual Studio client. -- [`NuGet.PackageManagement.UI.csproj`](../src/NuGet.Clients/NuGet.PackageManagement.UI/NuGet.PackageManagement.UI.csproj): Package Management UI elements for Visual Studio, Package Manager UI, Migrator, Options dialog. -- [`NuGet.PackageManagement.VisualStudio.csproj`](../src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/NuGet.PackageManagement.VisualStudio.csproj): NuGet's Visual Studio functionalities, integrations and utilities. -- [`NuGet.SolutionRestoreManager.csproj`](../src/NuGet.Clients/NuGet.SolutionRestoreManager/NuGet.SolutionRestoreManager.csproj): NuGet's Visual Studio Solution Restore Manager. -- [`NuGet.Tools.csproj`](../src/NuGet.Clients/NuGet.Tools/NuGet.Tools.csproj): NuGet's Visual Studio extension Package. -- [`NuGet.VisualStudio.Client.csproj`](../src/NuGet.Clients/NuGet.VisualStudio.Client/NuGet.VisualStudio.Client.csproj): Visual Studio Extensibility Package (vsix) -- [`NuGet.VisualStudio.Common.csproj`](../src/NuGet.Clients/NuGet.VisualStudio.Common/NuGet.VisualStudio.Common.csproj): NuGet's Visual Studio common types and interfaces used for both Package Manager UI, Package Manager Console, restore and install functionalities. -- [`NuGet.VisualStudio.Contracts.csproj`](../src/NuGet.Clients/NuGet.VisualStudio.Contracts/NuGet.VisualStudio.Contracts.csproj): RPC contracts for NuGet's Visual Studio Service Broker extensibility APIs. -- [`NuGet.VisualStudio.Implementation.csproj`](../src/NuGet.Clients/NuGet.VisualStudio.Implementation/NuGet.VisualStudio.Implementation.csproj): Implementation of the NuGet.VisualStudio extensibility APIs. -- [`NuGet.VisualStudio.Internal.Contracts.csproj`](../src/NuGet.Clients/NuGet.VisualStudio.Internal.Contracts/NuGet.VisualStudio.Internal.Contracts.csproj): -- [`NuGet.VisualStudio.Interop.csproj`](../src/NuGet.Clients/NuGet.VisualStudio.Interop/NuGet.VisualStudio.Interop.csproj): NuGet's Visual Studio client Template Wizard interop implementation. -- [`NuGet.VisualStudio.csproj`](../src/NuGet.Clients/NuGet.VisualStudio/NuGet.VisualStudio.csproj): APIs for invoking NuGet services in Visual Studio. - -### src\NuGet.Core - -- [`Microsoft.Build.NuGetSdkResolver.csproj`](../src/NuGet.Core/Microsoft.Build.NuGetSdkResolver/Microsoft.Build.NuGetSdkResolver.csproj): MSBuild SDK resolver for NuGet packages. -- [`NuGet.Build.Tasks.Console.csproj`](../src/NuGet.Core/NuGet.Build.Tasks.Console/NuGet.Build.Tasks.Console.csproj): NuGet Build tasks for MSBuild and dotnet restore. Contains restore logic using the MSBuild static graph functionality. -- [`NuGet.Build.Tasks.Pack.csproj`](../src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj): NuGet tasks for MSBuild and dotnet pack. -- [`NuGet.Build.Tasks.csproj`](../src/NuGet.Core/NuGet.Build.Tasks/NuGet.Build.Tasks.csproj): NuGet tasks for MSBuild and dotnet restore. -- [`NuGet.CommandLine.XPlat.csproj`](../src/NuGet.Core/NuGet.CommandLine.XPlat/NuGet.CommandLine.XPlat.csproj): NuGet executable wrapper for the dotnet CLI nuget functionality. -- [`NuGet.Commands.csproj`](../src/NuGet.Core/NuGet.Commands/NuGet.Commands.csproj): Complete commands common to command-line and GUI NuGet clients. -- [`NuGet.Common.csproj`](../src/NuGet.Core/NuGet.Common/NuGet.Common.csproj): Common utilities and interfaces for all NuGet libraries. -- [`NuGet.Configuration.csproj`](../src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj): NuGet's configuration settings implementation. -- [`NuGet.Credentials.csproj`](../src/NuGet.Core/NuGet.Credentials/NuGet.Credentials.csproj): NuGet client's authentication models. -- [`NuGet.DependencyResolver.Core.csproj`](../src/NuGet.Core/NuGet.DependencyResolver.Core/NuGet.DependencyResolver.Core.csproj): NuGet's PackageReference dependency resolver implementation. -- [`NuGet.Frameworks.csproj`](../src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj): NuGet's understanding of target frameworks. -- [`NuGet.LibraryModel.csproj`](../src/NuGet.Core/NuGet.LibraryModel/NuGet.LibraryModel.csproj): NuGet's types and interfaces for understanding dependencies. -- [`NuGet.Localization.csproj`](../src/NuGet.Core/NuGet.Localization/NuGet.Localization.csproj): NuGet localization package for dotnet CLI. -- [`NuGet.PackageManagement.csproj`](../src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj): NuGet Package Management functionality for Visual Studio installation flow. -- [`NuGet.Packaging.csproj`](../src/NuGet.Core/NuGet.Packaging/NuGet.Packaging.csproj): NuGet's understanding of packages. Reading nuspec, nupkgs and package signing. -- [`NuGet.ProjectModel.csproj`](../src/NuGet.Core/NuGet.ProjectModel/NuGet.ProjectModel.csproj): NuGet's core types and interfaces for PackageReference-based restore, such as lock files, assets file and internal restore models. -- [`NuGet.Protocol.csproj`](../src/NuGet.Core/NuGet.Protocol/NuGet.Protocol.csproj): NuGet's implementation for interacting with feeds. Contains functionality for all feed types. -- [`NuGet.Resolver.csproj`](../src/NuGet.Core/NuGet.Resolver/NuGet.Resolver.csproj): NuGet's dependency resolver for packages.config based projects. -- [`NuGet.Versioning.csproj`](../src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj): NuGet's implementation of Semantic Versioning. - - -## Core Unit Test Projects - -Unit tests for libraries and some clients. Located in `test/` folder. - -Projects in section: 18 - -### test\NuGet.Core.Tests - -- [`Microsoft.Build.NuGetSdkResolver.Test.csproj`](../test/NuGet.Core.Tests/Microsoft.Build.NuGetSdkResolver.Test/Microsoft.Build.NuGetSdkResolver.Test.csproj): Unit tests for Microsoft.Build.NuGetSdkResolver. -- [`NuGet.Build.Tasks.Console.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Build.Tasks.Console.Test/NuGet.Build.Tasks.Console.Test.csproj): Unit tests for NuGet.Build.Tasks.Console. -- [`NuGet.Build.Tasks.Pack.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Build.Tasks.Pack.Test/NuGet.Build.Tasks.Pack.Test.csproj): Unit tests for NuGet.Build.Tasks.Pack. -- [`NuGet.Build.Tasks.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Build.Tasks.Test/NuGet.Build.Tasks.Test.csproj): Unit tests for NuGet.Build.Tasks. -- [`NuGet.CommandLine.Xplat.Tests.csproj`](../test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/NuGet.CommandLine.Xplat.Tests.csproj): Unit tests for NuGet.CommandLine.XPlat. -- [`NuGet.Commands.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Commands.Test/NuGet.Commands.Test.csproj): Unit tests for NuGet.Commands. -- [`NuGet.Common.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Common.Test/NuGet.Common.Test.csproj): Unit tests for NuGet.Common. -- [`NuGet.Configuration.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Configuration.Test/NuGet.Configuration.Test.csproj): Unit tests for NuGet.Configuration. -- [`NuGet.Credentials.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Credentials.Test/NuGet.Credentials.Test.csproj): Unit tests for NuGet.Credentials. -- [`NuGet.DependencyResolver.Core.Tests.csproj`](../test/NuGet.Core.Tests/NuGet.DependencyResolver.Core.Tests/NuGet.DependencyResolver.Core.Tests.csproj): Unit tests for NuGet.DependencyResolver.Core. -- [`NuGet.Frameworks.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Frameworks.Test/NuGet.Frameworks.Test.csproj): Unit tests for NuGet.Frameworks. -- [`NuGet.LibraryModel.Tests.csproj`](../test/NuGet.Core.Tests/NuGet.LibraryModel.Tests/NuGet.LibraryModel.Tests.csproj): Unit tests for NuGet.LibraryModel. -- [`NuGet.Packaging.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Packaging.Test/NuGet.Packaging.Test.csproj): Unit tests for NuGet.Packaging. -- [`NuGet.ProjectModel.Test.csproj`](../test/NuGet.Core.Tests/NuGet.ProjectModel.Test/NuGet.ProjectModel.Test.csproj): Unit tests for NuGet.ProjectModel. -- [`NuGet.Protocol.Tests.csproj`](../test/NuGet.Core.Tests/NuGet.Protocol.Tests/NuGet.Protocol.Tests.csproj): Unit tests for NuGet.Protocol. -- [`NuGet.Resolver.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Resolver.Test/NuGet.Resolver.Test.csproj): Unit tests for NuGet.Resolver. -- [`NuGet.Shared.Tests.csproj`](../test/NuGet.Core.Tests/NuGet.Shared.Tests/NuGet.Shared.Tests.csproj): Unit tests for the utilities included using shared compilation. -- [`NuGet.Versioning.Test.csproj`](../test/NuGet.Core.Tests/NuGet.Versioning.Test/NuGet.Versioning.Test.csproj): Unit tests for NuGet.Versioning. - - -## Visual Studio Test Projects - -Projects in section: 11 - -### test\NuGet.Clients.Tests - -- [`NuGet.Indexing.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.Indexing.Test/NuGet.Indexing.Test.csproj): Unit tests for NuGet.Indexing. -- [`NuGet.MSSigning.Extensions.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.MSSigning.Extensions.Test/NuGet.MSSigning.Extensions.Test.csproj): An end-to-end test suite for NuGet.MSSigning.Extensions. Overlaps in tests with NuGet.MSSigning.Extensions.FuncTest. -- [`NuGet.PackageManagement.UI.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/NuGet.PackageManagement.UI.Test.csproj): Unit and integration tests for NuGet.PackageManagement.UI. -- [`NuGet.PackageManagement.VisualStudio.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.PackageManagement.VisualStudio.Test/NuGet.PackageManagement.VisualStudio.Test.csproj): Unit and integration tests for NuGet.PackageManagement.VisualStudio. -- [`NuGet.SolutionRestoreManager.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.SolutionRestoreManager.Test/NuGet.SolutionRestoreManager.Test.csproj): Unit and integration tests for NuGet.SolutionRestoreManager. -- [`NuGet.Tools.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.Tools.Test/NuGet.Tools.Test.csproj): Unit tests for NuGet.Tools. -- [`NuGet.VisualStudio.Common.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.VisualStudio.Common.Test/NuGet.VisualStudio.Common.Test.csproj): Unit and integration tests for NuGet.VisualStudio.Common. -- [`NuGet.VisualStudio.Implementation.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.VisualStudio.Implementation.Test/NuGet.VisualStudio.Implementation.Test.csproj): Unit and integration tests for NuGet.VisualStudio.Implementation. -- [`NuGet.VisualStudio.Internal.Contracts.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.VisualStudio.Internal.Contracts.Test/NuGet.VisualStudio.Internal.Contracts.Test.csproj): Unit and integration tests for NuGet.VisualStudio.Internal.Contracts. -- [`NuGet.VisualStudio.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.VisualStudio.Test/NuGet.VisualStudio.Test.csproj): Unit and integration tests for NuGet.VisualStudio. -- [`NuGetConsole.Host.PowerShell.Test.csproj`](../test/NuGet.Clients.Tests/NuGetConsole.Host.PowerShell.Test/NuGetConsole.Host.PowerShell.Test.csproj): Unit and integration tests for NuGet.PackageManagement.PowerShellCmdlets. - - -## Functional Test Projects - -Projects in section: 10 - -### test\NuGet.Clients.FuncTests - -- [`NuGet.CommandLine.FuncTest.csproj`](../test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/NuGet.CommandLine.FuncTest.csproj): A functional (end-to-end) test suite for NuGet.CommandLine. Contains tests for every nuget.exe command. -- [`NuGet.MSSigning.Extensions.FuncTest.csproj`](../test/NuGet.Clients.FuncTests/NuGet.MSSigning.Extensions.FuncTest/NuGet.MSSigning.Extensions.FuncTest.csproj): A functional (end-to-end) test suite for NuGet.MSSigning.Extensions. - -### test\NuGet.Clients.Tests - -- [`NuGet.CommandLine.Test.csproj`](../test/NuGet.Clients.Tests/NuGet.CommandLine.Test/NuGet.CommandLine.Test.csproj): An end-to-end test suite for NuGet.CommandLine. Contains tests for every nuget.exe CLI command. Overlaps in tests with NuGet.CommandLine.FuncTest. - -### test\NuGet.Core.FuncTests - -- [`Dotnet.Integration.Test.csproj`](../test/NuGet.Core.FuncTests/Dotnet.Integration.Test/Dotnet.Integration.Test.csproj): Integration tests for NuGet-powered dotnet CLI commands such as pack/restore/list package and dotnet nuget. -- [`Msbuild.Integration.Test.csproj`](../test/NuGet.Core.FuncTests/Msbuild.Integration.Test/Msbuild.Integration.Test.csproj): Integration tests for NuGet powered msbuild functionalities (restore/pack). -- [`NuGet.Commands.FuncTest.csproj`](../test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/NuGet.Commands.FuncTest.csproj): Integration tests for the more involved NuGet.Commands, such as restore. -- [`NuGet.Packaging.FuncTest.csproj`](../test/NuGet.Core.FuncTests/NuGet.Packaging.FuncTest/NuGet.Packaging.FuncTest.csproj): Integration tests for the more involved NuGet.Packaging functionality, such as signing. -- [`NuGet.Protocol.FuncTest.csproj`](../test/NuGet.Core.FuncTests/NuGet.Protocol.FuncTest/NuGet.Protocol.FuncTest.csproj): Integration tests for the more involved NuGet.Protocol functionality, such as plugins. -- [`NuGet.XPlat.FuncTest.csproj`](../test/NuGet.Core.FuncTests/NuGet.XPlat.FuncTest/NuGet.XPlat.FuncTest.csproj): Functional tests for nuget in dotnet CLI scenarios, using the NuGet.CommandLine.XPlat assembly. - -### test\NuGet.Core.Tests - -- [`NuGet.PackageManagement.Test.csproj`](../test/NuGet.Core.Tests/NuGet.PackageManagement.Test/NuGet.PackageManagement.Test.csproj): Unit tests for NuGet.PackageManagement.