BenchmarkDotNet
BenchmarkDotNet copied to clipboard
Problem with binding for SYSTEM.RUNTIME after first build, if solution is build a second time the problem does not occur
Problem occurs after fresh build of solution, the message that i receive is as follows:
// Validating benchmarks: // ***** BenchmarkRunner: Start ***** // ***** Found 1 benchmark(s) in total ***** // ***** Building 1 exe(s) in Parallel: Start ***** BuildScript: C:\Repos\oasys-combined\adsec\programs64\68d9caf6-a9ed-4a9c-bfe3-9c1c3a813299.bat // ***** Done, took 00:00:03 (3.97 sec) ***** // Found 1 benchmarks: // ReinforcedConcreteBenchmark.StrengthPerformance_RectangleProfile_Benchmark: DefaultJob
// ************************** // Benchmark: ReinforcedConcreteBenchmark.StrengthPerformance_RectangleProfile_Benchmark: DefaultJob // *** Execute *** // Launch: 1 / 1 // Execute: C:\Repos\oasys-combined\adsec\programs64\68d9caf6-a9ed-4a9c-bfe3-9c1c3a813299.exe --benchmarkName "AdSec_API_BenchmarkNet.ReinforcedConcreteBenchmark.StrengthPerformance_RectangleProfile_Benchmark" --job "Default" --benchmarkId 0 in // BeforeAnythingElse
// Benchmark Process Environment Information: // Runtime=.NET Framework 4.8 (4.8.4300.0), X64 RyuJIT // GC=Concurrent Workstation // Job: DefaultJob
OverheadJitting 1: 1 op, 271200.00 ns, 271.2000 us/op // Wrong assembly binding redirects for System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at AdSec_API_BenchmarkNet.ReinforcedConcreteBenchmark.StrengthPerformance_RectangleProfile_Benchmark() at BenchmarkDotNet.Autogenerated.Runnable_0.WorkloadActionNoUnroll(Int64 invokeCount) at BenchmarkDotNet.Engines.Engine.RunIteration(IterationData data) at BenchmarkDotNet.Engines.EngineFactory.Jit(Engine engine, Int32 jitIndex, Int32 invokeCount, Int32 unrollFactor) at BenchmarkDotNet.Engines.EngineFactory.CreateReadyToRun(EngineParameters engineParameters) at BenchmarkDotNet.Autogenerated.Runnable_0.Run(IHost host, String benchmarkName) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at BenchmarkDotNet.Autogenerated.UniqueProgramName.AfterAssemblyLoadingAttached(String[] args) // AfterAll // Benchmark Process 133196 has exited with code -1. // * Artifacts cleanup *
If the solution is build again the benchmark works as intended, I tried to modify build order but that did not help, I also tried to turn off auto reference and add reference to a project but it did not work looking for help.
Wrong assembly binding redirects for System.Runtime
Does your project define a file with assembly binding redirects? If so, could you try to remove the ones for System.Runtime ?
No response, closing