Conversation
…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>
timcassell
force-pushed
the
fix/weaver-bundled-assemblies
branch
from
September 5, 2026 10:40
f7b28b5 to
d782176
Compare
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Licensing
BenchmarkDotNet.Weaver.csprojpacks everything in its output directory intotasks/netstandard2.0, andBenchmarkDotNet.Annotations.csprojre-packs that same folder underIsFullPack. Since Annotations is a dependency of BenchmarkDotNet, AsmResolver's binaries ship to every consumer — withPrivateAssets="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.txtand packs it at the root of the Annotations package, which is the one that ships standalone. It sits besidepackages/*.nupkgso it also covers the checked-in package. All bundled assemblies are MIT, so this is attribution only — no license conflict.Over-copying
CopyLocalLockFileAssemblieswas also dragging in five assemblies the task never uses:Microsoft.NET.StringToolsSystem.Buffers,System.Memory,System.Numerics.Vectors,System.Runtime.CompilerServices.UnsafeAll are transitive from
Microsoft.Build.Framework/Microsoft.Build.Utilities.Coreand supplied by the MSBuild host at runtime; AsmResolver'snetstandard2.0build references onlynetstandard, and its ns2.0 dependency group is justAsmResolver.PEplus a source-only package.ExcludeAssets="runtime"on the two MSBuild references drops all five, leaving the four AsmResolver assemblies. Shipping our ownSystem.Memorynext to an MSBuild task was also a binding-redirect conflict risk underMSBuild.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 withFileNotFoundException: 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
MethodImplAttributesfrom the built assemblies, not by inspection:dotnetMSBuildAggressiveOptimizationapplied;NoInliningapplied,AggressiveInliningstrippedMSBuild.exeBenchmarkDotNet.dllEngine18/18,EngineJitStage10/10AggressiveOptimizationBenchmarkDotNet.TestsBenchmarkDotNet.Analyzers.TestsIntegration tests not run locally (NativeAOT native-link fails on this machine for environmental reasons); left to CI.
🤖 Generated with Claude Code