Legacy Documentation. View NUnit 3 Documentation

Runtime Selection

Before loading an assembly, NUnit must determine what runtime to use. By default (see below for exceptions) the following rules are used:

  1. If the assembly was built for the same runtime under which NUnit is currently running, then that runtime is used.

  2. If the assembly was built for a different runtime version and that version is available, NUnit uses it, running out of process if necessary.

  3. If the assembly was built for a different runtime version, which is not available, then the result depends on whether the build version is earlier or later than the current version. If earlier, the test will be run using the same runtime version under which NUnit is running. If later, then it is not possible to load the test and NUnit gives an error message.

  4. If multiple assemblies are being run at the same time, NUnit first determines the runtime under which each assembly was built. The highest version is then selected for the entire group, and rules 1 through 3 are applied.

Note: For versions 2.5.4 and 2.5.5, automatic runtime selection only works in the Gui runner. Use the /framework option to select the appropriate runtime under the Console runner.

Overriding the Defaults

The default runtime framework may be overridden using command line arguments, menu items in the Gui or settings in an NUnit project file. Provided that the requested framework is available, it will be used. If it isn't available, NUnit will issue an error message.

Note: To use version 1.x runtimes, you must have NUnit's support for those runtimes installed, in addition to the runtime itself. This support is an option of the NUnit installation.

Command Line Options

The /framework option of console runner allows you to specify the framework type and version to be used for a test run. See NUnit-Console Command Line Options for more information.

Gui Menu Selection

The main menu provides File | Select Runtime sub-items allowing you to reload the tests under a specific runtime. See Main Menu for more info.

Project Settings

The NUnit project format supports specification of a specific runtime to be used with a project at the configuration level. See Project Editor for more information.