Skip to content

BenchmarkDotNet fail in WPF project with .NET 5.0-windows target #1616

Closed
@lindexi

Description

@lindexi

Step:

  1. Create a WPF project
  2. Add BenchmarkDotNet package
  3. Add and run any Benchmark code

Running the Benchmark code that we can find error NU1201: Project Benchmark is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Project Benchmark supports: net5.0-windows7.0 (.NETCoreApp,Version=v5.0)

 Standard error:
   Restored f:\Code\lindexi\WpfInk\Benchmark\Benchmark.csproj (in 275 ms).
  Restored f:\Code\lindexi\WpfInk\WpfInk Old\WpfInkOld.csproj (in 84 ms).
  Restored f:\Code\lindexi\WpfInk\WpfInk\WpfInk.csproj (in 84 ms).
  Failed to restore f:\Code\lindexi\WpfInk\Benchmark\bin\Release\net5.0-windows\82790c3e-0ce6-4852-a0db-f9674aea9be3\BenchmarkDotNet.Autogenerated.csproj (in 86 ms).
f:\Code\lindexi\WpfInk\Benchmark\bin\Release\net5.0-windows\82790c3e-0ce6-4852-a0db-f9674aea9be3\BenchmarkDotNet.Autogenerated.csproj : error NU1201: Project Benchmark is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Project Benchmark supports: net5.0-windows7.0 (.NETCoreApp,Version=v5.0)
  Determining projects to restore...

// Build Error: Standard output:

 Standard error:
   Restored f:\Code\lindexi\WpfInk\Benchmark\Benchmark.csproj (in 275 ms).
  Restored f:\Code\lindexi\WpfInk\WpfInk Old\WpfInkOld.csproj (in 84 ms).
  Restored f:\Code\lindexi\WpfInk\WpfInk\WpfInk.csproj (in 84 ms).
  Failed to restore f:\Code\lindexi\WpfInk\Benchmark\bin\Release\net5.0-windows\82790c3e-0ce6-4852-a0db-f9674aea9be3\BenchmarkDotNet.Autogenerated.csproj (in 86 ms).
f:\Code\lindexi\WpfInk\Benchmark\bin\Release\net5.0-windows\82790c3e-0ce6-4852-a0db-f9674aea9be3\BenchmarkDotNet.Autogenerated.csproj : error NU1201: Project Benchmark is not compatible with net5.0 (.NETCoreApp,Version=v5.0). Project Benchmark supports: net5.0-windows7.0 (.NETCoreApp,Version=v5.0)
  Determining projects to restore...

Demo: https://github.com/lindexi/lindexi_gd/tree/f0b45eecb63e6ceef7a3abe5b43503abb317fd70/WpfInk

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions