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.).
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>true</IsPackable>
</PropertyGroup>
</Project>