I have a simple dotnet core class library with a single XUnit test method:
TestLib.csproj:
If you are targeting netstandard2.0 this will not work. If are using .NET Core. make sure the .csproj contains the following lines:
netcoreapp3.0
and also contains the package Microsoft.NET.Test.Sdk
Microsoft.NET.Test.Sdk