Skip to content

Add ARCHITECTURE.md for the NuGet.Client repository#7228

Open
aortiz-msft wants to merge 6 commits intodevfrom
dev-aortiz-architecture
Open

Add ARCHITECTURE.md for the NuGet.Client repository#7228
aortiz-msft wants to merge 6 commits intodevfrom
dev-aortiz-architecture

Conversation

@aortiz-msft
Copy link
Copy Markdown
Contributor

@aortiz-msft aortiz-msft commented Mar 23, 2026

Bug

Fixes: N/A

Description

Adds architecture.md file to help LLMs generate code for the repository.

Also:

  • Added skill to re-generate the architecture.md file when needed.
  • Removed project-overview.md file which was auto-generated and more limited in comparison.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@aortiz-msft aortiz-msft requested a review from a team as a code owner March 23, 2026 22:53
Copy link
Copy Markdown
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A left a bunch of comments that copilot should be able to fix.

I do think it's worth eliminating the duplication with project-overview since that is a smaller more compact version of this, but it doesn't really contain opinionated explanations like this one does.


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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly depends on is different here :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "depends on" data was probably obtained from the DGML file which was generated deterministically by Visual Studio. Are you saying this is wrong?

Copy link
Copy Markdown
Member

@nkolev92 nkolev92 Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not wrong.
Some places it lists the full closure, others just the top one. I don't see how/why.

I think a project level DGML, or ideally a mermaid for github is probably better than the text.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the DGML is auto-generated, and can be generated easily on-demand, I'm leaning towards not including these.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing them is fine I agree.
The diagram is much more useful and honestly makes the whole doc shorter leaves less room for something to become outdated.

Copy link
Copy Markdown
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking much better.

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).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).
See also [feature guide](docs/feature-guide.md), and the [coding guidelines](docs/coding-guidelines.md).

project-overview is no more.


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`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Versioning/NuGet.Versioning.csproj)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These links should be relative, otherwise they'll take out of the editor.
If you are looking at this in code clicking this will take you to a browser, but you actually want the local link.


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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing them is fine I agree.
The diagram is much more useful and honestly makes the whole doc shorter leaves less room for something to become outdated.


#### [`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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concrete types are not the ones I'd choose as "most important".

We can tweak them, or remove them.
My vote is remove them.


#### [`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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a payload package.


#### [`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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RestoreManagerPackage by design contains a slimmed down version of the NuGet assemblies, allowing the functionality to be loaded early without paying a performance cost.


Depends on: `NuGet.Commands`, `NuGet.PackageManagement`, `NuGet.VisualStudio`, `NuGet.VisualStudio.Internal.Contracts`, and core libraries.

#### [`NuGet.VisualStudio`](https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.VisualStudio/NuGet.VisualStudio.csproj)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were we gonna group these 2?


### 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`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants