Installing NUnit 2.6.4 using NuGet

This guide covers how to downgrade NUnit 3.0 to NUnit 2.6.4 using NuGet.

Developers that are writing tests in Visual Studio for Mac or using Xamarin.UITest should be using NUnit 2.6.4 as NUnit 3.0 or higher is not compatible with Visual Studio for Mac or Xamarin.UITest. Attempting to run unit tests in Visual Studio for Mac or Xamarin.UITests with NUnit 3.0 will fail.

This guide will discuss how to install NUnit 2.6.4 using NuGet for Visual Studio for Mac. These steps will also uninstall NUnit 3.0 if necessary.

Requirements

This guide assumes that there is an existing solution with a mobile app project and a test project.

Installing NUnit 2.6.4 in Visual Studio for Mac

The following steps describe how to install NUnit 2.6.4.

  1. Open the Package Manager - Right click on Packages and select Add Packages from the popup menu:

  2. Search for NUnit version:2.6.4 - Visual Studio for Mac will uninstall NUnit 3.0 (if necessary) and then download and install NUnit 2.6.4. In Add Packages dialog, enter the text nunit version:2.6.4 in the Search field located in the upper right hand corner. Select NUnit from the search results and click the Add Package button:

It is possible to confirm that NUnit 2.6.4 has been installed by inspecting the version number of the NUnit package in the Solution Pad:

Summary

This guide discussed how to downgrade NUnit 3.0 to NUnit 2.6.4 in Visual Studio for Mac using the Package Manager Console.