Skip to content

Annotate MSBuild in proc calls - #7554

Merged
Nigusu-Allehu merged 2 commits into
devfrom
dev-nyenework-annotate-msbuild
Jul 16, 2026
Merged

Annotate MSBuild in proc calls#7554
Nigusu-Allehu merged 2 commits into
devfrom
dev-nyenework-annotate-msbuild

Conversation

@Nigusu-Allehu

@Nigusu-Allehu Nigusu-Allehu commented Jul 10, 2026

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14987

Description

 dotnet/msbuild#14064  added  [RequiresUnreferencedCode]  to MSBuild's build execution APIs. This caused IL2026 errors in NuGet.Client's source build because both  NuGet.Build.Tasks.Console  and  NuGet.CommandLine.XPlat 

FYI a temporary fix was merged in the VMR by suppressing these warnings. This PR annotates the methods with RUC making them more honest instead of suppressing.

This PR will wait for backflow to avoid conflicts.

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 self-assigned this Jul 10, 2026
@Nigusu-Allehu
Nigusu-Allehu marked this pull request as ready for review July 10, 2026 18:58
@Nigusu-Allehu
Nigusu-Allehu requested a review from a team as a code owner July 10, 2026 18:58
Comment thread src/NuGet.Core/NuGet.Build.Tasks.Console/Program.cs
Comment thread src/NuGet.Core/NuGet.CommandLine.XPlat/Program.cs
@Nigusu-Allehu

Copy link
Copy Markdown
Member Author

Waiting for #7559 to merge. So that flow insertion does not have to deal with code conflicts. But we could also commit this to the VMR flow PR. Not feeling strongly about any of the approaches

jebriede
jebriede previously approved these changes Jul 14, 2026

@jebriede jebriede left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving with suggestions

Comment thread src/NuGet.Core/NuGet.CommandLine.XPlat/Utility/MSBuildAPIUtility.cs
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.

Properly annotate NuGet.Client in-proc MSBuild call sites for trimming (IL2026)

3 participants