I am completely stuck on this issue. So my team has a unit test project in a services test project. The tests are discovered in the test explorer pane however when I try and run the tests I get these errors:
'Multiple test adapters with the same uri 'executor://xunit/VsTestRunner2' were found. Ignoring adapter 'Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner'. Please uninstall the conflicting adapter(s) to avoid this warning'
'[xUnit.net 00:00:00.0251250] Skipping: (could not find dependent assembly 'Microsoft.Extensions.DependencyModel, Version=1.1.0')'
'No test is available in C:\. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.'
Context information:
My Test Projects project.json:
{ "version": "1.0.0-*", "testRunner": "xunit", "dependencies": { "dotnet-test-xunit": "2.2.0-preview2-build1029", "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.3", "Microsoft.DiaSymReader": "1.0.8", "Microsoft.DiaSymReader.Native": "1.4.1", "Microsoft.Extensions.Logging.Abstractions": "1.1.2", "Microsoft.Extensions.Testing.Abstractions": "1.0.0-preview2-003121", "Newtonsoft.Json": "9.0.1", "WebServices": "1.0.0-*", "xunit": "2.2.0", "xunit.abstractions": "2.0.1", "xunit.assert": "2.2.0", "xunit.core": "2.2.0", "xunit.extensibility.core": "2.2.0", "xunit.extensibility.execution": "2.2.0", "xunit.runner.utility": "2.2.0" }, "frameworks": { "net461": { "dependencies": { "Microsoft.NETCore.Platforms": "1.1.0" } } }
The Weird thing is that it works for my team members. But not me. The differences in our environments are: the latest update from Windows and Visual Studio, while they are an update or two behind.
Does anyone know of a workaround?
When you have the ignore attribute above a testmethod the test will be skipped. Now when you run your tests you will see that this test has been skipped. Indicated by the yellow exclamation mark.
Run tests in Test Explorer If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.
From the command line, create a folder for your test project, change into it, and then create the project using dotnet new : $ mkdir MyFirstUnitTests $ cd MyFirstUnitTests $ dotnet new xunit The template "xUnit Test Project" was created successfully.
Installing or updating "xunit.runner.visualstudio" package did the trick for me. Until that, it was not working with framework 462.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With