Unable to find testhost.dll. Please publish your test project and retry

前端 未结 19 1121
星月不相逢
星月不相逢 2021-02-01 11:40

I have a simple dotnet core class library with a single XUnit test method:

TestLib.csproj:


  
            


        
19条回答
  •  情话喂你
    2021-02-01 12:06

    I found a very interesting compatibility issue with a version. I did upgrade just as a normal practice, my code, and I switched to xUnit.runner.visualstudio 2.4.2. It stopped working for .Net Core 3.1. I had to downgrade to 2.4.1 and it started working again.

    Additional information after one of my comments.

    The package xunit.runner.visualstudio versions <= 2.4.1 includes a reference to Microsoft.NET.Test.Sdk. Later versions don't, so you need to add the reference to your project.

    See stackoverflow.com/a/63786758/3248302

提交回复
热议问题