Description
I have a benchmark project which csproj looks like this:
<Project Sdk="Microsoft.NET.Sdk;Microsoft.Build.CentralPackageVersions/2.0.79"> <PropertyGroup> <RootNamespace>ExampleNameSpace</RootNamespace> <AssemblyName>$(RootNamespace)</AssemblyName> <OutputType>Exe</OutputType> <TargetFrameworks>net5.0</TargetFrameworks> </PropertyGroup> <ItemGroup> <PackageReference Include="BenchmarkDotNet" /> </ItemGroup> <ItemGroup> </Project>
this project is part of a solution that has a Directory.Build.props file that contains configuration:
net462;netstandard2.0;net5.0
when I build the project using this command:
dotnet run -c release --framework net5.0
I get errors:
error NU1201: Project is not compatible with netstandard2.0 Project supports: net5.0
error NU1201: Project is not compatible with net462 Project supports: net5.0
when BDN tries to restore the project he generated.
when I go to the csproj the BDN generated, I can see that he generated it with configuration:
<TargetFramework>net5.0</TargetFramework>
instead of <TargetFrameworks>net5.0</TargetFrameworks>
notice the difference between the two is the missing 's'.
when I add the missing s, and run the bat file containing the commands the BDN tried to run everything works fine.
any suggestions how I can solve this problem?
versions of nugets I'm using:
Microsoft.NET.Test.Sdk: 16.9.1
BenchmarkDotNet: 0.13.0