Thursday 2 August 2018

Solving OutOfMemoryException and Getting NUnit Tests on Visual Studio Test Explorer

It is fun to work with latest tools and frameworks but sometimes errors are bit confusing and searching for fix is not that easy. One team worked with NUnit and .NET 471 and complaint that the when compiling they get outofmemory exception “ NUnit Adapter 3.7.0.0: Test discovery starting Exception System.OutOfMemoryException, Exception converting mytest” . Searching pointed to few links in GitHub issues as shown below but those workarounds seem to be not applicable as .NET framework change back to 462 is not an option.Fix was really simple but looking for a solution sometimes takes time. So let’s explore the problem and the simple fix.


The problem is as described in here could not run the tests and used Visual Studio is 2017 latest update 15.7.01

Test Explorer in Visual Studio is empty.02

Building with VSTS does not run unit tests saying no test found in the assemblies.04

05

The fix is as simple as typing few letters to change version of NUnit test adapter to version 3.10.03

Once build tests now appear in VS Test Explorer.06

Build in VSTS picks up and executes the tests. No need to specify the custom adapter paths for VSTS build to make it work. It automatically picks from build source directory packages.image

07

No comments:

Popular Posts