Search code examples
c#visual-studio-2015resharper-10.0

Could not load file or assembly MyNunitTest.dll or one of its dependencies


I cannot run Nunit in the newest .NET. Here are all the steps I do:

  1. New Project > Class Library (Package)
  2. Add NUnit 3.0.1
  3. Add the class:

Content:

using NUnit.Framework;

namespace MyNunitTest
{
    [TestFixture]
    public class TestClass
    {
        [Test]
        public void TestMethod()
        {
            Assert.That(true, Is.True);
        }
    }
}
  1. Run All

Error:

System.IO.FileNotFoundException: Could not load file or assembly MyNunitTest.dll or one of its dependencies. The system cannot find the file specified.


Solution

  • The solution for the main problem here is that the wrong project type has been chosen.

    To add a unit test project add a new Unit test project instead of a class library or any other type of project. Everything will work as expected.