Skip to main content
Source: AL0017HardcodedPackageVersionAnalyzer.cs

Description

Package versions should use MSBuild variables from Version.props for centralized version management. This ensures consistency across all projects and simplifies version updates.

Bad Code

<PackageVersion Include="Pkg" Version="1.0.0" />

Good Code

<PackageVersion Include="Pkg" Version="$(PkgVersion)" />

Properties

  • Category: VersionManagement
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0017.severity = warning