Skip to content
This repository was archived by the owner on Nov 27, 2017. It is now read-only.
This repository was archived by the owner on Nov 27, 2017. It is now read-only.

Test Discovery Error with ASPNET Core 1.1 #99

@Robula

Description

@Robula

There seems to be an issue that causes test-nunit to fail to discover tests when "Microsoft.AspNetCore.Mvc": "1.1.0" is added to the test project either directly or via another project reference.

Interestingly, removing the dependency to "Microsoft.AspNetCore.Mvc": "1.1.0" or simply lowering the version ("Microsoft.AspNetCore.Mvc": "1.0.2") allows my tests to be discovered.

Here is my project.json:

{
  "version": "1.0.0-*",

  "dependencies": {
    "NUnit": "3.6.0",
    "NUnit3TestAdapter": "3.6.0",
    "dotnet-test-nunit": "3.4.0-beta-3",
    "Moq": "4.6.38-alpha",
    "Microsoft.AspNetCore.Mvc": "1.1.0"
  },

  "testRunner": "nunit",

  "frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0",
          "type": "platform"
        }
      }
    }
  }
}

The error I get when I build and "Run All" tests is this:

------ Discover test started ------
NUnit Adapter 3.6.0.0: Test discovery starting
Error: Unable to get runner for this assembly. Check installation, including any extensions.
FileNotFoundException: Could not load file or assembly 'nunit.framework' or one of its dependencies. The system cannot find the file specified.
Dependent Assembly nunit.framework of D:\project\bin\Debug\netcoreapp1.1\Project.Tests.dll not found. Can be ignored if not a NUnit project.
NUnit Adapter 3.6.0.0: Test discovery complete
========== Discover test finished: 0 found (0:00:00.1140183) ==========
------ Discover test started ------
Discovering tests in 'D:\project\Project.Tests\project.json' ["C:\Program Files\dotnet\dotnet.exe" test "D:\project\Project.Tests\project.json" --output "D:\project\Project.Tests\bin\Debug\netcoreapp1.1" --port 15591 --parentProcessId 206184 --no-build]
'test-nunit' returned '-2'.
========== Discover test finished: 0 found (0:00:00.823869) ==========

'test-nunit' returned '-2'. resolves to INVALID_ASSEMBLY.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions