ProjGraph.Lib.Core
1.2.0
dotnet add package ProjGraph.Lib.Core --version 1.2.0
NuGet\Install-Package ProjGraph.Lib.Core -Version 1.2.0
<PackageReference Include="ProjGraph.Lib.Core" Version="1.2.0" />
<PackageVersion Include="ProjGraph.Lib.Core" Version="1.2.0" />
<PackageReference Include="ProjGraph.Lib.Core" />
paket add ProjGraph.Lib.Core --version 1.2.0
#r "nuget: ProjGraph.Lib.Core, 1.2.0"
#:package ProjGraph.Lib.Core@1.2.0
#addin nuget:?package=ProjGraph.Lib.Core&version=1.2.0
#tool nuget:?package=ProjGraph.Lib.Core&version=1.2.0
ProjGraph.Lib.Core
Core abstractions, parsers, and infrastructure for analyzing .NET solutions, projects, and source files.
Installation
dotnet add package ProjGraph.Lib.Core
Overview
ProjGraph.Lib.Core is the shared infrastructure layer for the ProjGraph library ecosystem. It provides:
- Solution & project parsers for
.sln(via Microsoft.VisualStudio.SolutionPersistence),.slnx, and.csprojfiles (via System.Xml.Linq); project files are read, never evaluated - Dependency injection extension methods for service registration
- Abstractions (
IProjectParser,ISolutionParser,IDiagramRenderer,IFileSystem, …) - Infrastructure services (
CompilationFactory,ProjectDiscoveryService,PhysicalFileSystem, …) - Graph algorithms (Tarjan's SCC for cycle detection)
This package is the foundation for all other ProjGraph.Lib.* packages. It is not usually referenced
on its own — use a purpose-specific package instead:
ProjGraph.Lib.DependenciesProjGraph.Lib.ClassDiagramProjGraph.Lib.EntityFrameworkProjGraph.Lib— meta-package (all of the above)
Usage
Register all core services:
using ProjGraph.Lib.Core;
services.AddProjGraphCore();
Parse a solution
using Microsoft.Extensions.DependencyInjection;
using ProjGraph.Lib.Core;
using ProjGraph.Lib.Core.Abstractions;
var services = new ServiceCollection();
services.AddProjGraphCore();
var provider = services.BuildServiceProvider();
// Resolve the parser matching the solution format: ISlnxParser for .slnx, ISlnParser for .sln.
var parser = provider.GetRequiredService<ISlnxParser>();
IEnumerable<string> projectPaths = parser.GetProjectPaths("MySolution.slnx");
Key Abstractions
| Interface | Description |
|---|---|
ISolutionParser |
Extracts project file paths from a solution (ISlnParser / ISlnxParser) |
IProjectParser |
Parses a single .csproj into a Project plus its references |
IProjectDiscoveryService |
Discovers referenced projects recursively and resolves their paths |
ICompilationFactory |
Creates Roslyn Compilation objects from project files |
IDiagramRenderer<T> |
Generic renderer producing a string diagram from a model |
IFileSystem |
Abstraction over System.IO for testability |
IOutputConsole |
Abstraction over console output (Spectre.Console-backed by default) |
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.CodeAnalysis.CSharp (>= 5.9.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.VisualStudio.SolutionPersistence (>= 1.0.52)
- ProjGraph.Core (>= 1.2.0)
- Spectre.Console (>= 0.57.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on ProjGraph.Lib.Core:
| Package | Downloads |
|---|---|
|
ProjGraph.Lib.Dependencies
Project dependency graph analysis, solution statistics, and ASCII/Mermaid rendering for .NET solutions. |
|
|
ProjGraph.Lib.EntityFramework
Entity Framework Core DbContext and ModelSnapshot analysis with Mermaid ERD generation for .NET projects. |
|
|
ProjGraph.Lib.ClassDiagram
Roslyn-powered class hierarchy analysis and Mermaid class diagram generation for .NET projects. |
GitHub repositories
This package is not used by any popular GitHub repositories.