AsmResolver Version
6.0.0.beta.6
.NET Version
No response
Operating System
Windows
Describe the Bug
When running in Visual Studio, ModuleDefinition.FromFile throws ArgumentNullException. It does not happen when running dotnet build on command line. The exception did not happen in either environment in beta.5.
How To Reproduce
Create an MSBuild task that runs during the build that calls ModuleDefinition.FromFile, run it in Visual Studio 2026. For an already existing repro, you can pull dotnet/BenchmarkDotNet@a0a31a0 and build it in VS.
Expected Behavior
No exception
Actual Behavior
System.ArgumentNullException: Value cannot be null.
Parameter name: v1
at System.Version.op_LessThan(Version v1, Version v2)
at AsmResolver.DotNet.TargetRuntimeProber.TraverseAssemblyReferences(MetadataStreamSelection& streams, DotNetRuntimeInfo& dotNetRuntimeInfo)
at AsmResolver.DotNet.TargetRuntimeProber.TryGetLikelyTargetRuntime(MetadataStreamSelection& streams, DotNetRuntimeInfo& targetRuntime)
at AsmResolver.DotNet.TargetRuntimeProber.TryGetLikelyTargetRuntime(PEImage image, DotNetRuntimeInfo& targetRuntime)
at AsmResolver.DotNet.Serialized.SerializedModuleDefinition..ctor(PEImage peImage, ModuleReaderParameters readerParameters)
at AsmResolver.DotNet.ModuleDefinition.FromImage(PEImage image, ModuleReaderParameters readerParameters, Boolean createRuntimeContext)
at BenchmarkDotNet.Weaver.WeaveAssemblyTask.Execute()
Additional Context
No response
AsmResolver Version
6.0.0.beta.6
.NET Version
No response
Operating System
Windows
Describe the Bug
When running in Visual Studio,
ModuleDefinition.FromFilethrowsArgumentNullException. It does not happen when running dotnet build on command line. The exception did not happen in either environment in beta.5.How To Reproduce
Create an MSBuild task that runs during the build that calls
ModuleDefinition.FromFile, run it in Visual Studio 2026. For an already existing repro, you can pull dotnet/BenchmarkDotNet@a0a31a0 and build it in VS.Expected Behavior
No exception
Actual Behavior
Additional Context
No response