Registry Mirror
Skip to content

Conversation

@timcassell

@timcassell timcassell commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

Licensing

BenchmarkDotNet.Weaver.csproj packs everything in its output directory into tasks/netstandard2.0, and BenchmarkDotNet.Annotations.csproj re-packs that same folder under IsFullPack. Since Annotations is a dependency of BenchmarkDotNet, AsmResolver's binaries ship to every consumer — with PrivateAssets="all" deliberately removing the dependency edge, so nothing points back to the origin project. MIT requires the copyright and permission notice to travel with the binaries, and no notices file existed.

Adds src/BenchmarkDotNet.Weaver/THIRD-PARTY-NOTICES.txt and packs it at the root of the Annotations package, which is the one that ships standalone. It sits beside packages/*.nupkg so it also covers the checked-in package. All bundled assemblies are MIT, so this is attribution only — no license conflict.

Over-copying

CopyLocalLockFileAssemblies was also dragging in five assemblies the task never uses:

  • Microsoft.NET.StringTools
  • System.Buffers, System.Memory, System.Numerics.Vectors, System.Runtime.CompilerServices.Unsafe

All are transitive from Microsoft.Build.Framework / Microsoft.Build.Utilities.Core and supplied by the MSBuild host at runtime; AsmResolver's netstandard2.0 build references only netstandard, and its ns2.0 dependency group is just AsmResolver.PE plus a source-only package. ExcludeAssets="runtime" on the two MSBuild references drops all five, leaving the four AsmResolver assemblies. Shipping our own System.Memory next to an MSBuild task was also a binding-redirect conflict risk under MSBuild.exe.

A NuGet dependency is not an alternative here: MSBuild loads a task assembly into a context that probes the task assembly's own directory and never consults the consuming project's package graph. Verified — with AsmResolver removed from tasks/ and referenced by the consumer instead, the task fails with FileNotFoundException: Could not load file or assembly 'AsmResolver.DotNet'.

Also

AsmResolver 6.0.0 → 6.0.1. License and copyright unchanged.

Verification

Weaving confirmed by reading MethodImplAttributes from the built assemblies, not by inspection:

Check Result
Weave under dotnet MSBuild AggressiveOptimization applied; NoInlining applied, AggressiveInlining stripped
Weave under VS 2022 MSBuild.exe identical
BenchmarkDotNet.dll Engine 18/18, EngineJitStage 10/10 AggressiveOptimization
Full solution, Release succeeded
BenchmarkDotNet.Tests net10.0 1167 passed · net472 1130 passed
BenchmarkDotNet.Analyzers.Tests net10.0 20256 passed · net472 20190 passed

Integration tests not run locally (NativeAOT native-link fails on this machine for environmental reasons); left to CI.

🤖 Generated with Claude Code

…ssemblies

The weaver task's dependencies are packed into tasks/netstandard2.0 of both
BenchmarkDotNet.Weaver and BenchmarkDotNet.Annotations, so AsmResolver's
binaries are redistributed to every consumer with no dependency edge and no
MIT notice. Add THIRD-PARTY-NOTICES.txt next to the weaver and pack it at the
root of the Annotations package, which is the one that ships standalone.

CopyLocalLockFileAssemblies also copied five assemblies the task never needs:
Microsoft.NET.StringTools, System.Buffers, System.Memory,
System.Numerics.Vectors and System.Runtime.CompilerServices.Unsafe. All are
transitive from the MSBuild packages and supplied by the MSBuild host at
runtime; AsmResolver's netstandard2.0 build references only netstandard.
ExcludeAssets="runtime" on the two MSBuild references drops them, leaving the
four AsmResolver assemblies.

Also update AsmResolver 6.0.0 -> 6.0.1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant