P010 NewDependencies
- Applies to
- Pull requests, through the GitHub App
- Severity
- Warning (fails the check under fail-on-warnings)
- Summary
- A change adds a package dependency.
- Flags
- Added PackageReference or PackageVersion in .csproj, .fsproj, .vbproj, .props, .targets; entries in package.json dependencies, devDependencies, peerDependencies, optionalDependencies; requirements*.txt lines; go.mod require lines. A package removed and re-added in the same file (version change) is not flagged. One finding per package; with central package management it is on the PackageVersion line. Generated files (<auto-generated in the first 10 lines) are skipped.
Before
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
After
<!-- System.Text.Json is in the shared framework; no package needed. -->
Fix
- Confirm the package was requested, or remove it and use what the project already has.