Why are .NET Core tests (dnxcore50) xUnit not showing up in VS2015 Test Explorer?

I know this question has been asked several times, but due to many changes in .NET Core they are becoming obsolete.

I have a simple .NET Core platform for targeting Core (not full .NET), now I want to set up the Tests project for it.

Both projects compile without problems, but I could not get the tests to show in Test Explorer in Visual Studio 2015.

Below are the project.json files that I managed to compile from several sources of documentation.

Do you see something that is missing, perhaps some kind of addiction?

=====================

I use:

  • Visual Studio 2015 Update 3
  • .NET Core 1.0.0 RC2

Myproject.dll

project.json

{ "version": "1.0.0-*", "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0" } }, "frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" } } } 

MyProject.Tests.dll

project.json

 { "version": "1.0.0-*", "dependencies": { "xunit.runner.dnx": "2.1.0-rc1-build204", "MyProject": "1.0.0-*", "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0" }, "xunit": "2.2.0-beta4-build3444" }, "frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" } } } 
+5
source share
1 answer

In my specific case (at least I have no problem running tests from VS or console). The xunit-related dependencies are as follows:

 "dotnet-test-xunit": "2.2.0-preview2-build1029", "xunit": "2.2.0-beta2-build3300", "xunit.extensibility.execution": "2.2.0-beta2-build3300", "xunit.runner.visualstudio": "2.2.0-beta2-build1149", 

Ignore the spesific versions. I believe the xunit.runner.visualstudio package is needed here

+2
source

Source: https://habr.com/ru/post/1261128/


All Articles