BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Metadata file could not be found when dependency project has different output directory

Open joshua-light opened this issue 4 years ago • 1 comments

Hi!

I'm running BenchmarkDotNet with the following setup:

  • Core.csproj: a library project with code that should be benchmarked
  • Benchmarks.csproj: a project that references Core.csproj and contains benchmarks

However, there are some unusual details that probably cause the problem:

  • Core.csproj has unusual build configs (not Debug or Release) and thus has unusual output directories
  • Benchmarks.csproj has standard build configs

When running Benchmarks.csproj, I get the following error:

error CS0006: Metadata file '...\bin\Release\Core.dll' could not be found [...\Benchmarks\bin\Release\net5.0\3ddcef73-2d0d-49c9-863f-b01de63a8ec3\BenchmarkDotNet.Autogenerated.csproj]

Seems like BenchmarkDotNet looks in the bin\Release for Core.dll, however, it is stored in bin\Different Release\Core.dll.

Is this a known issue or something that can be fixed? Thanks!

joshua-light avatar Aug 27 '21 11:08 joshua-light

I have a similar issue with the same project structure.

Benchmark.net tries to find the main project assembly under ProjectFolder\bin\x86\Release but my project compiles under ProjectFolder\bin\Release

samusaran avatar Apr 20 '22 12:04 samusaran