Cannot install NUnit with Xamarin Forms.


I'm trying to install the NUnit package in my Xamarin Forms project and I'm getting this error:

Severity Code Description Project File Line Suppression State
Error Could not install package 'NUnit 3.9.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

I'm working with Visual Studio 2017 and Windows 10.

Does anyone have any experience with this issue? It seems strange that there could be errors like this with such a common package...

Thanks so much!


  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭✭

    Check the dependencies for NUnit in NuGet Manager. You will have to set the target of your project to the .NET versions that it can work with.

    Secondly, I am not sure if the NUnit 3.9.0 will work with Xamarin. It doesn't work beyond 2.6.4.

  • mattwardmattward GBMember Xamurai

    NUnit 3.9 does not contain any assemblies that are compatible with PCL projects. It has a .NET Standard 1.3 assembly but version .NET Standard 1.3 is not compatible with any PCL profiles.

    So your options are:

    1. Use an older NUnit NuGet version, such as 2.6.4, as suggested by ShantimohanElchuri.
    2. Convert your PCL project to a .NET Standard project.

    Option 1 is probably the simpler of the two.

Sign In or Register to comment.