Benchmarkdotnet: Generate Exception: Unable to find <Project> in <Folder> and its subfolders

Created on 16 Jan 2019  路  4Comments  路  Source: dotnet/BenchmarkDotNet

I have a project Tests.Performance.csproj DotNet Core 2.2, with BenchmarkDotNet 0.11.3
The output Tests.Performance.dll is in sub-folder: \bin\Release. The program runs fine when the solution file is in this folder. When the solution is in another folder I get the following exceptions:

Unable to find .sln file. Will use current directory D:\S6\pc\src\Tests\Tests.Performance\bin\Release 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 Tests.Performance in D:\SW\pc\src\Tests.Performance\bin\Release and its subfolders. Most probably the name of output exe is different than the name of the .(c/f)sproj

Could you please help with it?

question

Most helpful comment

The message: "If you don't use .sln file on purpose it should not be a problem". In my case the project is in one from upper folder and you could find it without .sln. Could you please add such case?

All 4 comments

@adamsitnik could you take a look?

Would also be very helpfully if I could add a path to project by configuration. In this case I will not be required to have the same assembly name as the project name. It would probably solve and the problem above

When we generate the boilerplate code we need to reference the project that actually defines the benchmarks.

What we do as of today is that we walk the folders down until we find a folder with .sln file. From there, we search for $dllName.csproj including subfolders.

Would also be very helpfully if I could add a path to project by configuration. In this case I will not be required to have the same assembly name as the project name.

I think that this is too rare edge case to extend our configuration with another option. The error message is clear, this is our requirement to make it work.

If you have a better idea for how we can search for the project file, please let me know.

The message: "If you don't use .sln file on purpose it should not be a problem". In my case the project is in one from upper folder and you could find it without .sln. Could you please add such case?

Was this page helpful?
0 / 5 - 0 ratings