Skip to content

Instantly share code, notes, and snippets.

@GeorgDangl
Last active November 30, 2017 10:43
Show Gist options
  • Save GeorgDangl/b37049f3534f990723adb4c21e31439c to your computer and use it in GitHub Desktop.
Save GeorgDangl/b37049f3534f990723adb4c21e31439c to your computer and use it in GitHub Desktop.
Fixing xUnit not recognizing .Net Core framework 2.0
C:\Solution\test\Project.Tests>dotnet xunit
Detecting target frameworks in Project.Tests.csproj...
Building for framework netcoreapp2.0...
Dangl.AVA -> C:\Solution\src\Project\bin\Debug\netstandard1.3\Project.dll
Dangl.AVA.Tests -> C:\Solution\test\Project.Tests\bin\Debug\netcoreapp2.0\Project.Tests.dll
Running .NET Core 2.0 tests for framework netcoreapp2.0...
The specified framework version '2.0' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.0' was not found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '2.0'.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;netcoreapp1.1;netcoreapp1.0;net461;net46;net47</TargetFrameworks>
<!-- Required, otherwise multiple 2.0.x frameworks lead to xUnit not discovering the framework to run in -->
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">2.0.0</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20170914-09" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment