I have a simple dotnet core class library with a single XUnit test method:
TestLib.csproj:
In my case the problem was that I have an extension project for xunit. There is also a test project to test the extensions. When I ran dotnet test
on my solution, my extension project was also picked up as a unit test project (it took me some time to realize this). The reason for this is that it references some xunit packages. One of these xunit packages automatically sets the
property in you csprj file. This is actually a good thing since 99.99% of the projects that reference xunit are actually unit tests. I could finally solve this by explicitly setting
...
false
...
Manually in my csproj file. Then the problem went away.