Skip to content

no-floating-package-version

XMLsuspiciousno fixdefault: off

Reports a PackageReference or PackageVersion whose Version contains * (1.*), on the attribute. No fix, because the version to pin is a decision.

A floating version restores whatever is the newest match on the day of the build. Two builds of the same commit can use different packages, a new release can break the build without a change in the repository, and a compromised release arrives without anyone reading it.

To fix, pin the version (1.2.3), and update it on purpose.

Reported
<Project>
<ItemGroup>
<PackageReference Include="A" Version="1.0.0" />
<PackageReference Include="B" Version="1.*" />
<PackageVersion Include="C" Version="*" ></PackageVersion>
<Other Include="D" Version="1.*" />
</ItemGroup>
</Project>
xml:
lint:
rules:
no-floating-package-version: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line no-floating-package-version in a comment of the file’s language.