Skip to content

NuGetAutomaticPackagesRestore

Andrey Lipatkin edited this page Feb 8, 2015 · 3 revisions

What this rule is about?

Fails if there are references to nuget.targets from any .csproj file except those that are specified as exceptions.

Why should I enable this rule?

For more details why old approach to NuGet automatic package restore is not recommended anymore please look here: https://docs.nuget.org/Consume/Package-Restore/Migrating-to-Automatic-Package-Restore

How to enable/configure this rule

<Rules>
...
<NuGetAutomaticPackagesRestore enabled="true">
  <Exception>
    <Project>ProjectToExcludeFromCheck.csproj</Project>
  </Exception>
  <Exception>
    <Project>AnotherProjectToExcludeFromCheck.csproj</Project>
  </Exception>
</NuGetAutomaticPackagesRestore>
...
</Rules>