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