Skip to content

NuGetPackageVersions

Andrey Lipatkin edited this page Mar 4, 2015 · 8 revisions

What this rule is about?

This verification fails if version of NuGet package doesn't match specified criteria.

Why should I enable this rule?

Control and consistency.

How to enable/configure this rule

<Rules>
...
<NuGetPackageVersions enabled="false">
  <Package id="first-package-id" version="1.0.0" prerelease="false" />
  <Package id="second-package-id" version="[2.0.3]" />
  <Package id="third-package-id" version="[1.5.0, 2.0.0)" />
  <Package id="fourth-package-id" version="[1.5.0]|[1.6.0]" />
</NuGetPackageVersions>
...
</Rules>

Details about version ranges can be found here: http://docs.nuget.org/create/versioning#Specifying-Version-Ranges-in-.nuspec-Files. It is possible to specify multiple sub-rules separating them by '|' (see fourth-package-id example above).

Note that you can use new NuGetPackageUpdatesDetector tool to find gaps in rules: https://github.com/Litee/NuGetPackageUpdatesDetector