Skip to content
Andrey Lipatkin edited this page Feb 8, 2015 · 6 revisions

What this rule is about?

Checks that all packages specified in packages.config are referenced in corresponding .csproj file. Exceptions can include one or more package name (useful for tool packages that have no binaries to reference) or one or more project name or both (AND logic will be applied).

Why should I enable this rule?

Consistency, clean code base.

How to enable/configure this rule

<Rules>
...
<NuGetPackagesUsage enabled="true">
  <Exception>
    <Project>ProjectIsAllowedNotToReferenceSpecificPackage.csproj</Project>
    <Package>package-id</Package>
  </Exception>
  <Exception>
    <Package>second-package-id</Package>
  </Exception>
  <Exception>
    <Package>third-package-id</Package>
  </Exception>
</NuGetPackagesUsage>
...
</Rules>

Clone this wiki locally