Skip to content

DotNetSdkValidator failed when using CsProjClassicNetToolchain #2896

@filzrev

Description

@filzrev

Steps to reproduce problem

  1. Create simple benchmark dotnet project
  2. Modify project to use <TargetFrameworks>net48;net8.0</TargetFrameworks>
  3. Modify Program.cs with following content
    internal class Program
    {
        static void Main(string[] args)
        {
            var config = DefaultConfig.Instance
                .AddJob(Job.Dry.WithToolchain(CsProjClassicNetToolchain.Net48));
                // .AddJob(Job.Dry.WithToolchain(CsProjCoreToolchain.NetCoreApp80));
    
            BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
        }
    }
    
    public class Benchmarks
    {
        [Benchmark]
        public void Benchmark1() { };
    }
    
  4. Run program by using net8.0 framework.
  5. Following error is shown.
    // Validating benchmarks:
    // Benchmark Benchmark.IRunEveryWhere: Dry(Toolchain=.NET Framework 4.8, IterationCount=1, LaunchCount=1, RunStrategy=ColdStart, UnrollFactor=1, WarmupCount=1)
    //    * The required .NET Framework SDK version 8.0 or higher is not installed.
    

This problem is not occurred when running benchmark host project with net48.
And it seems not occurred when using BenchmarkDotNet v0.14.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions