I have for several project a common util project which consits of some base test classe, helper class and so on. The project definition looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<RootNamespace>SomeRoot.Util</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.2" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>
</Project>
I assume that since it references xUnit, that both the visual studio and the dotnet test
command treat it like a test project.
But since it isn't I would like to somehow prevent both the visual studio and dotnet test
to not recognize this project as a test project.
Removing the reference to xUnit is not an option since the base classes needs some interfaces from the xUnit package.
Fact
orTheory
defined in this project is discovered by the Visual Studio and shown in the Test Explorer – IngridingrimFact
means that it's a test, why do you need it for the base classes? – Vitricdotnet test
– Ingridingrimdotnet test
tries to execute the project even if there are no tests – Ingridingrimdotnet test
will pick up any project that has the xunit package installed, regardless whether there is anything in the project. – Larson<IsTestProject>true</IsTestProject>
help you? – Vitric<IsTestProject>true</IsTestProject>
solves the problem with thedotnet test
command – Ingridingrim