Proj1104: TUnit conflicts with Microsoft.NET.Test.Sdk
TUnit leverages source generators to locate and register tests as opposed to reflection. TUnit does this by building upon the Microsoft.Testing.Platform.
The use of Microsoft.NET.Test.Sdk interferes with the proper usage of TUnit, so only one of the two can be used. Note that the use of TUnit.Assertions is not affected.
See: TUnit FAQ
Non-compliant
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>exe</OutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup Label="Build tools">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" PrivateAssets="all" />
<PackageReference Include="TUnit" Version="0.13.20" PrivateAssets="all" />
</ItemGroup>
</Project>
Compliant
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>exe</OutputType>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup Label="Build tools">
<PackageReference Include="TUnit" Version="0.13.20" PrivateAssets="all" />
</ItemGroup>
</Project>