.NET project file analyzers community

Proj0804: Use Version only with Central Package Management not enabled

When Central Package Management is enabled, the use of the Version property on a <PackageReference> has no effect. It is most likely an mistake; or VersionOverride was intended, or the CPM has been unintentionally disabled.

Non-compliant

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

  <ItemGroup>
    <PackageReference Include="Qowaiv" Version="7.0.4" />
  </ItemGroup>

</Project>

Compliant

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

  <ItemGroup>
    <PackageReference Include="Qowaiv" VersionOverride="7.0.4" />
  </ItemGroup>

</Project>

or

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

  <ItemGroup>
    <PackageReference Include="Qowaiv" />
  </ItemGroup>

</Project>

or disable CPM.