-
-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support netcoreapp2.1 #587
Comments
@eerhardt big thanks for providing the bug report and the fix! |
No problem. Big thanks for the tool that is making my life easier! 😉 |
I have the same issue on fresh 0.11.2:
Why does it even try to use 2.0? I don't have not a single mentioning of I have just updated to the latest .NET Core 2.1, both Runtime and SDK. Even tried |
@qbit86 what are the target frameworks defined in you project with benchmarks? |
|
This benchmark works fine on my home machine, but not on my work machine. The config is: // https://benchmarkdotnet.org/articles/configs/configs.html
Job clrLegacyJitJob = new Job(Job.Default)
.With(Runtime.Clr)
.With(Platform.X86)
.With(Jit.LegacyJit)
.ApplyAndFreeze(RunMode.Short);
Job clrRyuJitJob = new Job(Job.Default)
.With(Runtime.Clr)
.With(Platform.X64)
.With(Jit.RyuJit)
.ApplyAndFreeze(RunMode.Short);
Job coreRyuJitJob = new Job(Job.Default)
.With(Runtime.Core)
.With(Platform.X64)
.With(Jit.RyuJit)
.ApplyAndFreeze(RunMode.Short);
IConfig config = ManualConfig.Create(DefaultConfig.Instance)
.With(MemoryDiagnoser.Default)
.With(clrLegacyJitJob)
.With(clrRyuJitJob)
.With(coreRyuJitJob);
Summary _ = BenchmarkRunner.Run<StringJoinBenchmark>(config); |
So BDN has two processes: host (what you run in the console) and child processes (for defined jobs) When you run the host process as .NET Core app (dotnet run -f netcoreapp2.1) we can check the .NET Core version (by using some reflection on loaded types) and we use the same version for running the benchmarks. However, when the host process is .NET (dotnet run -f net471) we can't check .NET Core version and we use 2.0 as the default. So in your case, I suspect that you run the host process as net471 and we use the default value. Suggested fix: make it explicit in the config that you want .NET Core 2.1 or always run the benchmarks from .NET Core host app (it can use relfection to check .NET Version and read registry keys to find out .NET SDK version) .With(CsProjCoreToolchain.NetCoreApp21); |
@adamsitnik
I've tried this, but it produces one more column in result table (Toolchain), which I'd prefer to avoid. Ok, another difference is that I've run benchmark with Rider on my home machine and with Visual Studio on my work machine. Can it make the difference?
Then how can I make Visual Studio to use netcoreapp2.1 on Ctrl+F5? |
When I try running a BenchmarkDotNet project that looks like the following:
I get the errors:
I'm using the latest .NET Core SDK from the master branch: https://github.com/dotnet/cli#installers-and-binaries and I have a NuGet.config that points to the daily builds of .NET Core:
I expected this to just work, like it does for
netcoreapp2.0
.The text was updated successfully, but these errors were encountered: