❔ ✅ 'Engines' does not exist in the namespace 'BenchmarkDotNet'
Other than a problem, I'm not sure what I've got going on here.
In the terminal, I've tried
dotnet run -c Release
, but it can't find the project. If I build it, and run dotnet PATH.exe
, it reports that A fatal error was encountered. The library 'hostpolicy.dll' required
. The error in the title is part of the output when I try to run the .exe from file explorer...I'm really not sure where to go from here.34 Replies
BenchmarkDotNet v0.13.7, Windows 10 (10.0.19045.3324/22H2/2022Update)
AMD Ryzen 7 2700X, 1 CPU, 16 logical and 8 physical cores
[Host] : .NET Framework 4.8.1 (4.8.9167.0), X86 LegacyJIT
Show your csproj and code
You're aware that .NET Framework is legacy since a few years back and should not be used for new development without very good reasons?
dotnet run
is specifically for modern dotnet, not for framework"Beginner" 🤷♂️
I just wanted to play with some benchmarks and made a new console app in Rider
okay, then the answer to your question is you picked the wrong application type when you made your program
recommended app type?
.net 6 or above console
pick from the green box, not red
for a benchmarkdotnet project, use "Console"
is there an easy way to change that in Rider?
this is rider.
i figure they want to change their current project
if you already made your project using the wrong template, just create a new project
the easy way is to just delete the old one yeah
then copy over the code files manually
only the .cs files
Fair enough, I packed everything into Program.cs, so copying it is trivial
might need some slight editing, or not
depends on what you wrote 🙂
but yeah, avoid .net framework
the modern versions are just called .NET, no prefix or suffix
.NET 7 is the latest and greatest fully released, with .NET 8 dropping in november
I'm mostly playing with Unity, so the latest and greatest will take awhile to reach me 😅
yeah, Unity isnt compatible with the modern dotnet versions yet sadly
I'm not even sure what versions it is compatible with...
4.7.2 iirc
@pobiega, you're a beautiful being. Thank you for your assistance.
One other question though, which directory do I need to be in for the run command to work?
the one that has the .csproj in it
It didn't work from the solution file. I just built the project and ran the exe from file explorer
solution files are legacy
project files is what we care about now
Ah, ok so just one level deeper
Any opinions/heuristics on a suitable run time for a benchmark?
solution files are certainly not legacy
not any more than they've ever been
they basically just serve to "collect" one or multiple projects
i would run the benchmark on the framework that you plan on using in the code that implements whatever you're testing
i'm unsure if it's possible to combine netfx runtime monikers on .net benchmarks
unity is either ns2.0 or netfx472
(both are valid)
I have much to research.
They are thou. In framework, you would target the sln with most commands/operations. Thats not the case with
dotnet
that almost exclusively targets projects directly. Look at tools like slngeni mean that's just not true. you can use sdk-style projects for netfx
yeah looks like you can add
[SimpleJob(RuntimeMoniker.Net472)]
to your benchmark classmint
Use
/close
🙂awe snap
The conversation was good, I didn't mean to kill it.
Thanks for you help team
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.