.NET project file analyzers community

Proj0200: Define the project packability explicitly

To prevent confusion, explicitly define the <IsPackable> node. Setting the IsPackable to true indicates that the package should be packed when the dotnet pack command is executed. This results in the creation of a NuGet package.

Projects that have IsPackable set to false will not be packed when the dotnet pack command is executed. This is particularly useful as it prevents the unintended creation of NuGet packages for projects that were not intended as such (test projects, etc.).

Non-compliant

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

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

</Project>

Compliant

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

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

</Project>