C
C#11mo ago
Foolminate

❔ ✅ '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
Foolminate
Foolminate11mo ago
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
Pobiega
Pobiega11mo ago
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
Foolminate
Foolminate11mo ago
"Beginner" 🤷‍♂️ I just wanted to play with some benchmarks and made a new console app in Rider
Pobiega
Pobiega11mo ago
okay, then the answer to your question is you picked the wrong application type when you made your program
Foolminate
Foolminate11mo ago
recommended app type?
ero
ero11mo ago
.net 6 or above console
Pobiega
Pobiega11mo ago
Pobiega
Pobiega11mo ago
pick from the green box, not red for a benchmarkdotnet project, use "Console"
Foolminate
Foolminate11mo ago
is there an easy way to change that in Rider?
Pobiega
Pobiega11mo ago
this is rider.
ero
ero11mo ago
i figure they want to change their current project
Pobiega
Pobiega11mo ago
if you already made your project using the wrong template, just create a new project
ero
ero11mo ago
the easy way is to just delete the old one yeah
Pobiega
Pobiega11mo ago
then copy over the code files manually only the .cs files
Foolminate
Foolminate11mo ago
Fair enough, I packed everything into Program.cs, so copying it is trivial
Pobiega
Pobiega11mo ago
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
Foolminate
Foolminate11mo ago
I'm mostly playing with Unity, so the latest and greatest will take awhile to reach me 😅
Pobiega
Pobiega11mo ago
yeah, Unity isnt compatible with the modern dotnet versions yet sadly
Foolminate
Foolminate11mo ago
I'm not even sure what versions it is compatible with...
Pobiega
Pobiega11mo ago
4.7.2 iirc
Foolminate
Foolminate11mo ago
Foolminate
Foolminate11mo ago
@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?
Pobiega
Pobiega11mo ago
the one that has the .csproj in it
Foolminate
Foolminate11mo ago
It didn't work from the solution file. I just built the project and ran the exe from file explorer
Pobiega
Pobiega11mo ago
solution files are legacy project files is what we care about now
Foolminate
Foolminate11mo ago
Ah, ok so just one level deeper Any opinions/heuristics on a suitable run time for a benchmark?
ero
ero11mo ago
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)
Foolminate
Foolminate11mo ago
I have much to research.
Pobiega
Pobiega11mo ago
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 slngen
ero
ero11mo ago
i 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 class
Foolminate
Foolminate11mo ago
mint
Pobiega
Pobiega11mo ago
Use /close 🙂
Foolminate
Foolminate11mo ago
awe snap The conversation was good, I didn't mean to kill it. Thanks for you help team
Accord
Accord11mo ago
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.
Want results from more Discord servers?
Add your server
More Posts