Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 980 Bytes

File metadata and controls

36 lines (28 loc) · 980 Bytes

Proj0453: Using Microsoft.NET.Test.Sdk implies a test project

The inclusion of Microsoft.NET.Test.Sdk implies that the project is a test project. Although there might be exceptions to this rule, in most cases including the SDK is done to run unit tests with the dotnet test command.

Non-compliant

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup Label="Build tools">
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" PrivateAssets="all" />
  </ItemGroup>
  
</Project>

Compliant

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <IsTestProject>true</IsTestProject>
  </PropertyGroup>

  <ItemGroup Label="Build tools">
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" PrivateAssets="all" />
  </ItemGroup>
  
</Project>