0

I have a somewhat weird problem: I have installed Visual Studio 2015 and 2017 RC on my system, as well as Asp.Net Core 1.0 and 1.1

I have build a new Solution, containing a new Asp.net Core 1.1 Project - called Upload

Upload dependencies

Now I want to add an Xunit Test Project, which can be done either from the CLI or via menu, I tried both. This project has the following dependencies: Test dependencies

But now the whole solution fails to compile, b/c Xunit seems to be netcore 1.0, whereas my project is 1.1?!? Errors

How can I solve this? I am unsure if I have installed something wrong, or if there is another rational explanation.

Christian Sauer
  • 10,351
  • 10
  • 53
  • 85
  • **BUMP!** I'm having the same problem. And lets note the xUnit docs for using with .Net Core http://xunit.github.io/docs/getting-started-dotnet-core.html just say it is has built in support, not helpful. – rayepps Mar 24 '17 at 04:15
  • @raykrow I have to say I am extremely disappointed by the xunit documentation or lack thereof.I work with py.test a lot, and the documentation is much better than Xunits. Xunits don't even cover "how to do Basic Things" questions! – Christian Sauer Mar 24 '17 at 06:02

1 Answers1

0

After a lot of digging into GitHub issues and other SO posts I finally fixed the issue by following the direction of BalassaMartin here.

TL;DR: install the Microsoft.NET.Test.Sdk NuGet first. My guess is that xunit.runners.visualstudio references a previous version of Microsoft.TestPlatform.ObjectModel that does not target .NET Core. Adding the Microsoft.NET.Test.Sdk package solves the problem because it references the 15.0.0 version.

After doing this the xunit.runner.visualstudio package installed fine. However now I'm back to the classic problem of not being able to actually see my tests in the explorer because VS can't find them.

I'll update when solved if the visibility issue is relevant to OP

Update

The reasons I still could not find tests was a dotnet core version mixup. Its likely to happen to a lot of people. See SO post for solution.

Community
  • 1
  • 1
rayepps
  • 2,072
  • 1
  • 12
  • 22