Check Nuget Dependencies Task
Motivation
When creating nuget packages, keeping the version requirements in the nuspec file can be tedious. Every time a dependency is updated, the version requirements have to be checked.
The Appccelerate.CheckNugetDependenciesTask checks whether all needed dependencies are present in the nuspec file and whether versions match with references in the project file. If the check fails, the build fails.
The CheckNugetDependenciesTask makes only sense when packages are created from nuspec files. When creating packages from project files, nuget will add all needed dependencies automatically.
Features
- checks dependencies and their versions in nuspec file against references in project file
- integrated in build process
- supports regular expressions for defining exclusions
Installation
You can install the CheckNugetDependenciesTask using nuget. The package id is Appccelerate.CheckNugetDependenciesTask
.
Check rules
The CheckNugetDependenciesTask checks both nuget and framework dependencies.
Nuget Dependencies
The CheckNugetDependenciesTask checks whether there is a corresponding dependency for every nuget dependency found in the packages.config file. Development dependencies are excluded, though. They are normally not part of the create package, but only used inside the project (e.g. Stylecop).
Current Limitations
The task can currently only parse nuget version restrictions in the form of [<from>,<to>)
When you reference a nuget package that has dependencies to further dependencies. These dependencies must be added, too. Otherwise the task will fail.
Framework dependencies
The CheckNugetDependenciesTask checks whether there is a corresponding framework dependency for every reference in the project file that has no hint path.