Skip to content

Move to manifest based event source - #7164

Merged
Nigusu-Allehu merged 4 commits into
devfrom
dev-nyenework-manifest-etw
Mar 3, 2026
Merged

Nigusu-Allehu merged 4 commits into
devfrom
dev-nyenework-manifest-etw

Conversation

@Nigusu-Allehu

@Nigusu-Allehu Nigusu-Allehu commented Feb 23, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14783

Description

Replaces the single public NuGetEventSource static class in NuGet.Common with per-assembly internal sealed manifest-based EventSource classes. This makes ETW tracing AOT-compatible

What changed:

  • Deleted NuGet.Common.NuGetEventSource (public static class wrapping EventSource.Write<T>(), which uses reflection and is not AOT-safe)
  • Created 4 internal EventSource classes, one per assembly:
    - CommonEventSource (provider: Microsoft-NuGet-Common)
    - ConfigurationEventSource (provider: Microsoft-NuGet-Configuration)
    - CommandsEventSource (provider: Microsoft-NuGet-Commands)
    - SdkResolverEventSource (provider: Microsoft-NuGet-SdkResolver)

Breaking change: NuGet.Common.NuGetEventSource is removed from the public API surface. ETW consumers must update provider names from Microsoft-NuGet to the assembly-specific names listed above.

Perfview reads from restore orchardcore

Before and now

image
Before After Status
Microsoft-NuGet/DependencyGraphResolver/CreateRestoreTargetGraph/Start Microsoft-NuGet-Commands/DependencyGraphResolver_CreateRestoreTargetGraph/Start Changed
Microsoft-NuGet/DependencyGraphResolver/CreateRestoreTargetGraph/Stop Microsoft-NuGet-Commands/DependencyGraphResolver_CreateRestoreTargetGraph/Stop Changed
Microsoft-NuGet/DependencyGraphResolver/ResolveDependencyGraphItems/Start Microsoft-NuGet-Commands/DependencyGraphResolver_ResolveDependencyGraphItems/Start Changed
Microsoft-NuGet/DependencyGraphResolver/ResolveDependencyGraphItems/Stop Microsoft-NuGet-Commands/DependencyGraphResolver_ResolveDependencyGraphItems/Stop Changed
Microsoft-NuGet/MigrationRunner/Run/Start Microsoft-NuGet-Common/MigrationRunner_Run/Start Changed
Microsoft-NuGet/MigrationRunner/Run/Stop Microsoft-NuGet-Common/MigrationRunner_Run/Stop Changed
Microsoft-NuGet/RestoreCommand/BuildAssetsFile/Start Microsoft-NuGet-Commands/RestoreCommand_BuildAssetsFile/Start Changed
Microsoft-NuGet/RestoreCommand/BuildAssetsFile/Stop Microsoft-NuGet-Commands/RestoreCommand_BuildAssetsFile/Stop Changed
Microsoft-NuGet/RestoreCommand/BuildRestoreGraph/Start Microsoft-NuGet-Commands/RestoreCommand_BuildRestoreGraph/Start Changed
Microsoft-NuGet/RestoreCommand/BuildRestoreGraph/Stop Microsoft-NuGet-Commands/RestoreCommand_BuildRestoreGraph/Stop Changed
Microsoft-NuGet/RestoreCommand/CalcNoOpRestore/Start Microsoft-NuGet-Commands/RestoreCommand_CalcNoOpRestore/Start Changed
Microsoft-NuGet/RestoreCommand/CalcNoOpRestore/Stop Microsoft-NuGet-Commands/RestoreCommand_CalcNoOpRestore/Stop Changed
Microsoft-NuGet/RestoreResult/WriteAssetsFile/Start Microsoft-NuGet-Commands/RestoreResult_WriteAssetsFile/Start Changed
Microsoft-NuGet/RestoreResult/WriteAssetsFile/Stop Microsoft-NuGet-Commands/RestoreResult_WriteAssetsFile/Stop Changed
Microsoft-NuGet/RestoreResult/WriteCacheFile/Start Microsoft-NuGet-Commands/RestoreResult_WriteCacheFile/Start Changed
Microsoft-NuGet/RestoreResult/WriteCacheFile/Stop Microsoft-NuGet-Commands/RestoreResult_WriteCacheFile/Stop Changed
Microsoft-NuGet/RestoreResult/WriteDgSpecFile/Start Microsoft-NuGet-Commands/RestoreResult_WriteDgSpecFile/Start Changed
Microsoft-NuGet/RestoreResult/WriteDgSpecFile/Stop Microsoft-NuGet-Commands/RestoreResult_WriteDgSpecFile/Stop Changed
Microsoft-NuGet/RestoreResult/WritePackagesLockFile/Start Microsoft-NuGet-Commands/RestoreResult_WritePackagesLockFile/Start Changed
Microsoft-NuGet/RestoreResult/WritePackagesLockFile/Stop Microsoft-NuGet-Commands/RestoreResult_WritePackagesLockFile/Stop Changed
Microsoft-NuGet/RestoreRunner/CommitAsync/Start Microsoft-NuGet-Commands/RestoreRunner_CommitAsync/Start Changed
Microsoft-NuGet/RestoreRunner/CommitAsync/Stop Microsoft-NuGet-Commands/RestoreRunner_CommitAsync/Stop Changed
Microsoft-NuGet/RestoreRunner/RestoreProject/Start Microsoft-NuGet-Commands/RestoreRunner_RestoreProject/Start Changed
Microsoft-NuGet/RestoreRunner/RestoreProject/Stop Microsoft-NuGet-Commands/RestoreRunner_RestoreProject/Stop Changed
Microsoft-NuGet/SettingsFile/FileRead/Start Microsoft-NuGet-Configuration/SettingsFile_FileRead/Start Changed
Microsoft-NuGet/SettingsFile/FileRead/Stop Microsoft-NuGet-Configuration/SettingsFile_FileRead/Stop Changed
Microsoft-NuGet/SettingsLoadingContext/FileRead Microsoft-NuGet-Configuration/SettingsLoadingContext_FileRead Changed
N/A Microsoft-NuGet-Commands/ManifestData Added
N/A Microsoft-NuGet-Common/ManifestData Added
N/A Microsoft-NuGet-Configuration/ManifestData Added

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.

@Nigusu-Allehu Nigusu-Allehu mentioned this pull request Feb 23, 2026
1 of 3 tasks
@Nigusu-Allehu Nigusu-Allehu self-assigned this Feb 26, 2026
@Nigusu-Allehu
Nigusu-Allehu marked this pull request as ready for review February 26, 2026 23:48
@Nigusu-Allehu
Nigusu-Allehu requested a review from a team as a code owner February 26, 2026 23:48
@Nigusu-Allehu
Nigusu-Allehu requested a review from zivkan February 27, 2026 18:15
@Nigusu-Allehu

Copy link
Copy Markdown
Member Author

The new events, I am assuming are as a result of using manifest based event source but I need to look into it

Event Status
Microsoft-NuGet-Commands/ManifestData Added
Microsoft-NuGet-Common/ManifestData Added
Microsoft-NuGet-Configuration/ManifestData

@nkolev92

nkolev92 commented Mar 2, 2026

Copy link
Copy Markdown
Member

You have an SDK breaking change.
Please create and issue and link it in this PR.

@Nigusu-Allehu Nigusu-Allehu added the Breaking-change Label for .NET SDK breaking changes. label Mar 2, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET SDK Breaking Change Notification email list.

You can refer to the .NET SDK breaking change guidelines

@nkolev92

nkolev92 commented Mar 2, 2026

Copy link
Copy Markdown
Member

issue wise, note that I am taliking about a nuget/hoem tracking issue (which we need anyways).
we don't need to follow the SDK breaking change process since this doesn't affect the restore command functionality.

@Nigusu-Allehu Nigusu-Allehu removed Breaking-change Label for .NET SDK breaking changes. needs-breaking-change-doc-created labels Mar 2, 2026
@Nigusu-Allehu

Copy link
Copy Markdown
Member Author

issue wise, note that I am taliking about a nuget/hoem tracking issue (which we need anyways). we don't need to follow the SDK breaking change process since this doesn't affect the restore command functionality.

Oh makes sense.

@Nigusu-Allehu
Nigusu-Allehu merged commit c041177 into dev Mar 3, 2026
16 checks passed
@Nigusu-Allehu
Nigusu-Allehu deleted the dev-nyenework-manifest-etw branch March 3, 2026 00:52
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.

Move NuGet Event Source to a manifest based event source

4 participants