Skip to content

Fix package validation telemetry assembly resolution warnings#13144

Merged
JanProvaznik merged 2 commits intodotnet:mainfrom
JanProvaznik:fix-package-validation-telemetry-resolution
Jan 29, 2026
Merged

Fix package validation telemetry assembly resolution warnings#13144
JanProvaznik merged 2 commits intodotnet:mainfrom
JanProvaznik:fix-package-validation-telemetry-resolution

Conversation

@JanProvaznik
Copy link
Member

Summary

During build, package validation emits warnings about being unable to resolve Microsoft.VisualStudio.Telemetry.dll:

Could not resolve reference 'Microsoft.VisualStudio.Telemetry.dll' directly or transitively referenced by 'ref/net472/Microsoft.Build.dll' (...) in any of the provided search directories.

This occurs because Microsoft.Build.Framework references Microsoft.VisualStudio.Telemetry with PrivateAssets="all" for net472 (to enable telemetry in Visual Studio scenarios). When package validation runs on packages like Microsoft.Build that depend on Framework, it cannot resolve this private reference.

Fix

Add the telemetry package path to ApiCompatAdditionalSearchPaths in Directory.Build.targets, allowing the package validation to locate the assembly.

Testing

  • Built locally with .\build.cmd -v quiet - warnings no longer appear
  • Build succeeds with 0 errors

Copilot AI review requested due to automatic review settings January 29, 2026 14:08
@JanProvaznik JanProvaznik requested a review from a team as a code owner January 29, 2026 14:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an additional API compat search path so package validation can resolve Microsoft.VisualStudio.Telemetry.dll (referenced privately by Microsoft.Build.Framework on net472) and stop emitting resolution warnings during builds.

Changes:

  • Extends ApiCompatAdditionalSearchPaths when package validation is enabled to include the Telemetry package’s net472 assembly directory.
  • Documents the rationale in Directory.Build.targets to clarify why the extra search path is needed.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JanProvaznik JanProvaznik enabled auto-merge (squash) January 29, 2026 14:14
@ViktorHofer
Copy link
Member

As the previous owner of APICompat & PackageValidation, a quick comment. Note that this message will get emitted with low importance starting with 11.0 as these additional assemblies aren't essential for package validation to perform correctly and in most cases just add noise.

@JanProvaznik JanProvaznik merged commit 33d9fd7 into dotnet:main Jan 29, 2026
9 checks passed
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.

4 participants