How can I get the NUnit3TestAdapter to work with .Net Standard 2.0?

How can I get the NUnit3TestAdapter to work with .Net Standard 2.0?

I get the following error:

1> C: \ Nikeza \ Mobile \ Nikeza.Mobile \ Tests \ ExampleBased.fsproj:

warning NU1701: The package "NUnit3TestAdapter 3.9.0" was restored using '.NETFramework, Version = v4.6.1' instead of the project target scheme '.NETStandard, Version = v2.0.

This package may not be fully compatible with your project. 1> ExampleBased → C: \ Nikeza \ Mobile \ Nikeza.Mobile \ Tests \ Bin \ Debug \ netstandard2.0 \ ExampleBased.dll

+4
source share
1 answer

, , 3.9.0 NUnit .NET Standard 2.0 F #. , .NET Standard. .NET Core .NET 4.6.1+. , , .NET Standard. , , .NET Standard, .

F # .NET Core dotnet NUnit NUnit, .NET Core .NET Standard.

:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>

    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Tests.fs" />
    <Compile Include="Program.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
    <PackageReference Include="NUnit" Version="3.9.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MathService\MathService.fsproj" />
  </ItemGroup>

</Project>
+3

Source: https://habr.com/ru/post/1691565/


All Articles