question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet test failed integration test after new .net core sdk installed

See original GitHub issue

Here is my xunit test project:

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

 <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
    <PackageReference Include="moq" Version="4.12.0" />
    <PackageReference Include="xunit" Version="2.4.0" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
  </ItemGroup>

All was good up until I installed .NET Core 3.1 SDK, now all my integration tests failed. I checked in different machines as long as I have only .NET Core 2.1 every thing is good but by installing .NET Core 3.1 all integration tests failed.

Is there any config I should add to my project? It’s not an option for me to upgrade my project or test project to 3.1.

It seems it is a .net issue and not a xunit: https://github.com/xunit/xunit/issues/2066

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nohwndcommented, Feb 20, 2020

That’s interesting could you post the actual failure please?

You can pin your dotnet version using global.json that way, you know what you will be invoking against. For example like this:

dotnet new globaljson --sdk-version 2.1.804
Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio unable to run .NET Core tests
The issue occurred after installing .NET Core SDK 3.1.x. This change must of done something to Visual Studio Test settings.
Read more >
Integration tests in ASP.NET Core
Learn how integration tests ensure that an app's components function correctly at the infrastructure level, including the database, ...
Read more >
How To Resolve Issue Of Test Project Not Running The ...
Introduction. I was upgrading the .NET Core 3.1 project to .NET 6 and faced issues running test cases in my test projects.
Read more >
too particular about .NET Core runtime version
Test Explorer recently stopped running my unit tests on the .NET ... NET Core SDKs installed: 2.1.302 [C:\Program Files\dotnet\sdk] 2.1.509 ...
Read more >
dotnet test failed to run test after update to 2019.1.2
I have updated my TeamCity server to latest version 2019.1.2 and nunit(v3) tests are not ran anymore from me with a strange error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found