Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1005 Bytes

File metadata and controls

46 lines (35 loc) · 1005 Bytes

Proj0209: Define the project readme file explicitly

To ensure the creation of well-formed NuGet packages, explicitly define the <PackageReadmeFile> node or disable package generation by defining the <IsPackable> node with value false.

Non-compliant

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

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

</Project>

Compliant

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

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <IsPackable>true</IsPackable>
    <PackageReadmeFile>README.md</PackageReadmeFile>
  </PropertyGroup>

  <ItemGroup>
    <None Include="README.md" Pack="true" PackagePath="" />
  </ItemGroup>

</Project>

Or disable packability:

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

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

</Project>