.NET project file analyzers community

Proj0026: Remove IncludeAssets when redundant

When all assets are private, none of them will be included. Due to that, there is not really a point in specifying the IncludeAssets.

More about controlling dependency assets can be read here.

Non-compliant

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

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>
  
   <ItemGroup Label="Non-compliant">
    <PackageReference Include="coverlet.collector" Version="6.0.2">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime;build</IncludeAssets>
    </PackageReference>
    <PackageReference Include="NUnit.Analyzers" Version="4.3.0" PrivateAssets="All" IncludeAssets="runtime;build;native; contentfiles;analyzers;buildtransitive" />
  </ItemGroup>

</Project>

Compliant

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

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>
  
   <ItemGroup Label="Non-compliant">
    <PackageReference Include="coverlet.collector" Version="6.0.2">
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="NUnit.Analyzers" Version="4.3.0" PrivateAssets="All" />
  </ItemGroup>

</Project>