Meziantou.Framework.DependencyScanning
2.0.7
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Meziantou.Framework.DependencyScanning --version 2.0.7
NuGet\Install-Package Meziantou.Framework.DependencyScanning -Version 2.0.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.DependencyScanning" Version="2.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.DependencyScanning" Version="2.0.7" />
<PackageReference Include="Meziantou.Framework.DependencyScanning" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meziantou.Framework.DependencyScanning --version 2.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Meziantou.Framework.DependencyScanning, 2.0.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Meziantou.Framework.DependencyScanning@2.0.7
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meziantou.Framework.DependencyScanning&version=2.0.7
#tool nuget:?package=Meziantou.Framework.DependencyScanning&version=2.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Meziantou.Framework.DependencyScanning
A .NET library for scanning source code directories and files to discover and manage project dependencies across multiple package ecosystems and configuration formats.
Features
- Multi-format Support: Scan dependencies from various project files and configuration formats
- Multiple Package Ecosystems: NuGet, npm, PyPI, Docker, Ruby Gems, Helm Charts, and more
- Parallel Scanning: High-performance parallel file scanning with configurable degree of parallelism
- Dependency Updates: Locate and update dependency versions programmatically
- Customizable Scanning: Filter by file patterns, dependency types, and custom predicates
Supported Dependency Types
The library can detect the following dependency types:
- NuGet - .NET packages from NuGet.org
- Npm - JavaScript packages from npmjs.com
- PyPi - Python packages from PyPI
- DockerImage - Docker container images
- GitReference - Git submodules and references
- DotNetSdk - .NET SDK versions
- DotNetTargetFramework - .NET target frameworks
- GitHubActions - GitHub Actions workflows and reusable workflows
- AzureDevOpsVMPool - Azure DevOps VM pool images
- AzureDevOpsTask - Azure DevOps pipeline tasks
- AzureDevOpsTemplate - Azure DevOps pipeline templates
- HelmChart - Helm chart dependencies
- RubyGem - Ruby gems
- RenovateConfiguration - Renovate configuration extends
- MSBuildProjectReference - MSBuild project references
Usage
Scan a Directory
using Meziantou.Framework.DependencyScanning;
// Scan with default options
var dependencies = await DependencyScanner.ScanDirectoryAsync(
"C:\\MyProject",
options: null,
cancellationToken);
foreach (var dependency in dependencies)
{
Console.WriteLine($"{dependency.Type}: {dependency.Name}@{dependency.Version}");
}
Scan with Custom Options
var options = new ScannerOptions
{
// Number of parallel scanning tasks (default: 16)
DegreeOfParallelism = 8,
// Recurse into subdirectories (default: true)
RecurseSubdirectories = true,
// Filter files to scan
ShouldScanFilePredicate = (directory, fileName) =>
{
return !fileName.StartsWith(".");
},
// Filter directories to recurse into
ShouldRecursePredicate = (directory, name) =>
{
return name != "node_modules" && name != "bin";
}
};
var dependencies = await DependencyScanner.ScanDirectoryAsync(
@"C:\MyProject",
options,
cancellationToken);
Filter by Dependency Type
var options = new ScannerOptions
{
// Only scan for specific dependency types
IncludedDependencyTypes = [DependencyType.NuGet, DependencyType.Npm].ToImmutableHashSet(),
};
// Or exclude specific types
var options2 = new ScannerOptions
{
ExcludedDependencyTypes = [DependencyType.DockerImage].ToImmutableHashSet(),
};
Stream Dependencies as They're Found
await DependencyScanner.ScanDirectoryAsync(
"C:\\MyProject",
options: null,
onDependencyFound: dependency =>
{
Console.WriteLine($"Found: {dependency.Name}@{dependency.Version}");
},
cancellationToken);
Scan Individual Files
// Scan a single file
var dependencies = await DependencyScanner.ScanFileAsync(
rootDirectory: "C:\\MyProject",
filePath: "C:\\MyProject\\package.json",
options: null,
cancellationToken);
// Scan multiple specific files
var filePaths = new[]
{
"C:\\MyProject\\package.json",
"C:\\MyProject\\MyProject.csproj"
};
var dependencies = await DependencyScanner.ScanFilesAsync(
rootDirectory: "C:\\MyProject",
filePaths,
options: null,
cancellationToken);
Update Dependency Versions
var dependencies = await DependencyScanner.ScanDirectoryAsync(
"C:\\MyProject",
options: null,
cancellationToken);
// Update all NuGet packages to version 2.0.0
foreach (var dependency in dependencies.Where(d => d.Type == DependencyType.NuGet))
{
if (dependency.VersionLocation?.IsUpdatable == true)
{
await dependency.UpdateVersionAsync("2.0.0", cancellationToken);
}
}
Custom Regex Scanner
For custom file formats, you can use the RegexScanner:
var options = new ScannerOptions
{
Scanners =
[
new RegexScanner
{
FilePatterns = [Glob.Parse("**/*.custom", GlobOptions.IgnoreCase)],
DependencyType = DependencyType.DockerImage,
RegexPattern = @"image:\s*(?<name>[a-z/]+)(:(?<version>[0-9.]+))?"
}
]
};
var dependencies = await DependencyScanner.ScanDirectoryAsync(
"C:\\MyProject",
options,
cancellationToken);
The regex pattern must include named groups:
name- The dependency name (required)version- The dependency version (optional)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- LibGit2Sharp (>= 0.31.0)
- Meziantou.Framework.Globbing (>= 2.0.3)
- Newtonsoft.Json (>= 13.0.4)
- YamlDotNet (>= 16.3.0)
-
net8.0
- LibGit2Sharp (>= 0.31.0)
- Meziantou.Framework.Globbing (>= 2.0.3)
- Newtonsoft.Json (>= 13.0.4)
- YamlDotNet (>= 16.3.0)
-
net9.0
- LibGit2Sharp (>= 0.31.0)
- Meziantou.Framework.Globbing (>= 2.0.3)
- Newtonsoft.Json (>= 13.0.4)
- YamlDotNet (>= 16.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0 | 45 | 7/5/2026 |
| 2.0.20 | 49 | 7/5/2026 |
| 2.0.19 | 266 | 6/13/2026 |
| 2.0.18 | 177 | 6/7/2026 |
| 2.0.17 | 103 | 5/31/2026 |
| 2.0.16 | 227 | 5/24/2026 |
| 2.0.15 | 111 | 5/23/2026 |
| 2.0.14 | 179 | 5/14/2026 |
| 2.0.13 | 123 | 5/11/2026 |
| 2.0.12 | 680 | 5/3/2026 |
| 2.0.11 | 305 | 4/25/2026 |
| 2.0.10 | 213 | 4/12/2026 |
| 2.0.9 | 154 | 3/29/2026 |
| 2.0.8 | 163 | 3/22/2026 |
| 2.0.7 | 710 | 1/25/2026 |
| 2.0.6 | 279 | 1/18/2026 |
| 2.0.5 | 1,037 | 11/16/2025 |
| 2.0.4 | 413 | 10/27/2025 |
| 2.0.3 | 148 | 10/19/2025 |
| 2.0.2 | 225 | 10/5/2025 |
Loading failed