How to get Nunit Test Adapter Framework working with .netcore 3.1

I seem to get this error when building my nunit project with .netcoreapp 3.1 and I can't figure out what mismatch version I have. I noticed a similar post on here but with a difference, where it said i should have a Nunit and UnitTestAdapter version 3.9.0 but VS won't allow me to rollback and I don't see why I would need to anyway. Error when buidling my solution is:

Any help in trying to resolve this error would be appreciated?

Package 'NUnitTestAdapter.WithFramework 2.0.0' was restored using '.NETFramework,Version=v4.6.1, 
.NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, 
.NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. 
This package may not be fully compatible with your project. 

My test.csproj is:

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

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>

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

  <ItemGroup>
    <None Remove="App1.config" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Chromium.ChromeDriver" Version="2.37.0" />
    <PackageReference Include="Dapper" Version="2.0.90" />
    <PackageReference Include="DapperExtensions" Version="1.7.0" />
    <PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
    <PackageReference Include="ExtentReports" Version="4.1.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
    <PackageReference Include="NUnit" Version="3.13.2" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
    <PackageReference Include="NUnitTestAdapter.WithFramework" Version="2.0.0" />
    <PackageReference Include="RestSharp" Version="106.11.7" />
    <PackageReference Include="Selenium.Chrome.WebDriver" Version="85.0.0" />
    <PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
    <PackageReference Include="SpecFlow" Version="3.8.7" />
    <PackageReference Include="SpecFlow.Assist.Dynamic" Version="1.4.2" />
    <PackageReference Include="SpecFlow.NUnit" Version="3.8.7" />
    <PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.8.7" />
    <PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
    <PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
    <PackageReference Include="WebDriverChromeDriver" Version="2.10.0" />
  </ItemGroup>



Read more here: https://stackoverflow.com/questions/68486089/how-to-get-nunit-test-adapter-framework-working-with-netcore-3-1

Content Attribution

This content was originally published by Trombone Man at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: