I'm trying to create a new PCL library (along with a new Windows Universal app), and I've created a new project to start writing my unit tests using xUnit. I've added nuget references to xunit
, as well as xunit.runner.visualstudio
. I'm using Visual Studio 2015 RTM, as well as Resharper 9.1, and bother of them give me a similar error when trying to run or discover the unit tests. This is from visual studio:
------ Discover test started ------
[xUnit.net 00:00:00.2661814] Skipping: WinBlur.NewsBlurClient.Tests (could not find dependent assembly 'xunit.core, Version=2.1.0')
[xUnit.net 00:00:00.2235684] Skipping: WinBlur.NewsBlurClient.Tests (could not find dependent assembly 'xunit.core, Version=2.1.0')
========== Discover test finished: 0 found (0:00:00.6920785) ==========
This output shows trying to use the latest beta versions of 2.1, but I've tried both the current release version (2.0.0) as well and I get the same result.
Here's my project.json
file:
{
"supports": {
"net46.app": {},
"uwp.10.0.app": {}
},
"dependencies": {
"Microsoft.NETCore": "5.0.0",
"Microsoft.NETCore.Portable.Compatibility": "1.0.0",
"xunit": "2.0.0",
"xunit.core": "2.0.0",
"xunit.assert": "2.0.0",
"xunit.runner.visualstudio": "2.0.1"
},
"frameworks": {
"dotnet": {
"imports": "portable-net452+win81"
}
}
}
When I added the nuget reference to xunit, it did not originally add the dependencies for xunit.core
and xunit.assert
, so I added those myself to see if it helped, but no luck.
xunit.core
andxunit.assert
explicitly shouldn't have any effect, so I suggest you remove them. FYI there is another discussion with a very similar problem here, that might help you: github.com/NuGet/Home/issues/1084 – Andrew Arnott