Skip to content

Commit

Permalink
Build script: Fix xUnit test run for .NET Core (#553)
Browse files Browse the repository at this point in the history
Sadly, .NET Core tooling doesn't seem to be smart enough anymore to
choose an appropriate .NET Core runtime host version itself when it is
given `netcoreapp2.0` as the target platform. If we don't explicitly
tell it which precise host version to use, it'll flat out refuse to
execute code (the xUnit tests, in our case).

Alternatively, I'm not smart enough to understand .NET Core. But I
seem to remember that things used to just work not too long ago.

See https://github.com/dotnet/cli/issues/7901.
  • Loading branch information
stakx committed Dec 15, 2017
1 parent 806e991 commit 78328ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Source\Moq.csproj" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Moq.Tests/Moq.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<DefineConstants>$(DefineConstants);DESKTOP;FEATURE_CAS;FEATURE_CODEDOM;FEATURE_COM;FEATURE_SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
</PropertyGroup>

Expand Down

0 comments on commit 78328ed

Please sign in to comment.