dotnet / BenchmarkDotNet

Powerful .NET library for benchmarking
https://benchmarkdotnet.org
MIT License
10.52k stars 968 forks source link

does not work with vb.net #1785

Open eschneider999 opened 3 years ago

eschneider999 commented 3 years ago

does not work with vb.net

Unable to find .sln or .csproj file. Will use current directory G:\Dev\FrozenElephant\SymbioticORM\Benchmarks\bin\netcoreapp2.0 to search for project file. If you don't use .sln file on purpose it should not be a problem.

// Generate Exception: Unable to find Benchmarks in G:\Dev\FrozenElephant\SymbioticORM\Benchmarks\bin\netcoreapp2.0 and its subfolders. Most probably the name of output exe is different than the name of the .(c/f)sproj

adamsitnik commented 3 years ago

The error message does not mention that, but we search for .vbproj as well:

https://github.com/dotnet/BenchmarkDotNet/blob/f372668e028161d0d1bf675811a6168967175034/src/BenchmarkDotNet/Toolchains/CsProj/CsProjGenerator.cs#L159

Most probably the name of output exe is different than the name of the .(c/f)sproj

What is the name of your project file and output assembly that defines the benchmarks?

eschneider999 commented 3 years ago

Benchmarks.vbproj Benchmarks.dll

it's console app

eschneider999 commented 3 years ago

.net core 2.0 project, not sure if that's the problem?

Used to work, but some one on here added the vbproj, it was for me a long time ago. output is Benchmarks.dll which seems strange to me, I would think it should be a exe as a console app.

adamsitnik commented 3 years ago

The way the logic is implemented:

  1. Go down in the folder hierarchy (in your case it starts from G:\Dev\FrozenElephant\SymbioticORM\Benchmarks\bin\netcoreapp2.0) until you find .sln file.
  2. From there, search recursively for a project file that matches assembly name.

So if it's not project and assembly name mismatch, it's most likely lack of .sln file:

Unable to find .sln or .csproj file. Will use current directory G:\Dev\FrozenElephant\SymbioticORM\Benchmarks\bin\netcoreapp2.0 to search for project file. If you don't use .sln file on purpose it should not be a problem.

https://github.com/dotnet/BenchmarkDotNet/blob/f372668e028161d0d1bf675811a6168967175034/src/BenchmarkDotNet/Toolchains/CsProj/CsProjGenerator.cs#L147-L162

eschneider999 commented 3 years ago

proj is here: G:\Dev\FrozenElephant\SymbioticORM\Benchmarks\ my solution file is here: G:\Dev\FrozenElephant\SymbioticORM\Symbiotic\

i also have another sln in there