MvcStructureInspector 3.0.0
See the version list below for details.
dotnet tool install --global MvcStructureInspector --version 3.0.0
dotnet new tool-manifest
dotnet tool install --local MvcStructureInspector --version 3.0.0
#tool dotnet:?package=MvcStructureInspector&version=3.0.0
nuke :add-package MvcStructureInspector --version 3.0.0
MVC Structure Inspector
A Roslyn-powered .NET global CLI tool for static structural analysis of ASP.NET Core MVC projects.
Overview
MVC Structure Inspector performs deep Abstract Syntax Tree (AST) traversal of ASP.NET Core MVC projects using the .NET Compiler Platform (Roslyn). It produces comprehensive structural reports and gap analysis across:
- C# source files — namespaces, classes, interfaces, structs, records, enums, delegates, fields, properties, constructors, methods, nested types, attribute metadata, lambda expressions, closures, and captured variable analysis
- Razor views —
@model,@inject,@section,@RenderBody,<partial>,asp-for,ViewBag/ViewData, form actions, and tag helpers - Static assets — all files under
wwwroot/compared via SHA-256 content hashing - Project files —
.csprojproperties, package references, project references, and.slnproject registry - Snapshot-based drift detection — serialize a project baseline, then compare against a live project at any future point
- Intelligent
.gitignoregeneration — multi-ecosystem detection (15+ project types), nested/hybrid project awareness, safe merge, custom patterns
Installation
dotnet tool install --global MvcStructureInspector
Requirements: .NET 10.0 SDK or later · Windows / Linux / macOS
Commands
Inspect a Project
mvc-inspect <path>
Generates a full structural tree report with timestamped filename to prevent overwriting:
[OK] Report saved to:
C:\source\MyApp\mvc-structure_20260306_064429.txt
Snapshot: C:\source\MyApp\mvc-structure_20260306_064429.snapshot.json
A .snapshot.json file is automatically saved alongside the text report for future drift detection.
Gap Analysis Between Two Projects
mvc-inspect --compare <referenceProject> <targetProject>
Compares project [A] (reference) against project [B] (target) and produces a detailed gap report with:
- Executive summary with quantified gap counts
- Per-file, per-type, and per-member differential analysis
- Razor view element-level comparison
- Static asset (wwwroot) content comparison via SHA-256
- Developer task checklist for alignment
Drift Detection from Saved Report
mvc-inspect --from-report <report.txt|.snapshot.json> <projectPath>
Loads a previously saved project snapshot as the baseline [A] and compares it against a live project [B]. This enables tracking structural drift over time without access to the original source.
Open an Existing Report
mvc-inspect open <report-file>
Opens any report file with the system default viewer.
Generate .gitignore
mvc-inspect gitignore <path>
Scans the project directory for all ecosystems and generates a comprehensive .gitignore:
- 15+ project types: .NET, Node.js, Python, Rust, Go, Java, Ruby, PHP, Swift, Dart/Flutter, Unity, Terraform, Docker, Visual Studio, JetBrains
- Nested/hybrid detection: automatically detects projects within projects (e.g., Node.js
ClientApp/inside a .NET solution) - Safety guarantee: never overwrites an existing
.gitignore— creates.gitignore.generated_*instead - Merge mode:
--mergeappends only missing patterns to an existing.gitignore - Custom patterns:
--addlets you specify additional patterns - Preview mode:
--previewshows the output without writing any file
Scanning: C:\source\MyApp
Detected 3 ecosystem(s):
• DotNet: 2 location(s)
└─ . (via App.sln)
└─ src (via Api.csproj)
• NodeJs: 1 location(s)
└─ ClientApp (via package.json)
• Python: 1 location(s)
└─ scripts (via requirements.txt)
⚠ 3 nested/hybrid project(s) detected — patterns applied globally.
[OK] .gitignore saved to:
C:\source\MyApp\.gitignore
Self-Verification
mvc-inspect verify
Runs 32 automated checks across six categories — no access keys or credentials required:
- Assembly Integrity — version metadata, SHA-256 hash, Roslyn dependency
- Security Guard — protected extensions, output path guards, timestamped reports, gitignore validation
- Runtime Compatibility — .NET version, UTF-8 encoding, SHA-256 crypto, file system access
- Dependency Integrity — all referenced assemblies resolvable, Roslyn version compatible
- File System Safety — system directory detection, temp access, path traversal guard
- OS Kernel Diagnostics — 11 lambda-based probes (kernel version, process info, CPU count, architecture, uptime, GC memory, timezone, culture)
Version Information
mvc-inspect -v
mvc-inspect --version
Displays version, runtime, OS, and product links.
Options
| Option | Description |
|---|---|
-v, --version |
Show version and build information |
--out <file> |
Override the auto-generated output path |
--open |
Open the report automatically after generation |
--with-proj |
Include .csproj and .sln comparison (compare mode only) |
--no-views |
Exclude .cshtml Razor view files |
--cs-only |
Analyze C# source files only |
--no-migrations |
Exclude the Migrations directory |
Gitignore Options
| Option | Description |
|---|---|
--preview |
Preview the generated .gitignore without writing to disk |
--merge |
Merge with existing .gitignore (append only unique patterns) |
--add <patterns> |
Add custom ignore patterns (e.g., --add "*.log" "tmp/" "secrets/") |
Report Structure
Single Project Report (mvc-structure_*.txt)
MyMvcApp/
├── Controllers/
│ └── HomeController.cs
│ namespace: MyMvcApp.Controllers
│ + class HomeController : Controller
│ - ApplicationDbContext _context
│ + HomeController(ApplicationDbContext context) [constructor]
│ + IActionResult Index()
│ + IActionResult About()
├── Models/
│ └── User.cs
│ namespace: MyMvcApp.Models
│ + class User
│ + int Id { get; set; }
│ + string Name { get; set; }
└── Views/
└── Home/
└── Index.cshtml
Type: [View]
@model MyMvcApp.Models.HomeViewModel
Layout = "_Layout"
asp-for="Name"
Gap Analysis Report (mvc-gap-report_*.txt)
The report contains six sections:
- Executive Summary — quantified gap counts across all categories
- C# File Gaps — missing, extra, or structurally modified source files
- Type & Member Differentials — class, interface, method, and property-level changes
- Static File Gaps — wwwroot content comparison with file sizes and SHA-256 hashes
- Project File Gaps —
.csprojproperty and package reference differentials,.slnproject registry comparison - Developer Task Checklist — actionable items to align project [B] with reference [A]
Security
- Protected Extensions — the tool refuses to overwrite sensitive file types (
.cs,.csproj,.sln,.json,.dll,.exe,.key,.pfx, etc.) - Timestamped Reports — automatic filenames with
yyyyMMdd_HHmmsspattern prevent accidental overwrites - Gitignore Safety —
.gitignoregeneration never overwrites existing files; validates output paths stay within the project directory - CodeQL Scanning — every release undergoes automated static security analysis
- SBOM Generation — CycloneDX Software Bill of Materials included with each release
Build from Source
git clone https://github.com/sbay-dev/mvc-inspect
cd mvc-inspect
dotnet build src/MvcStructureInspector.csproj -c Release
dotnet test tests/MvcStructureInspector.Tests/ -c Release
dotnet pack src/MvcStructureInspector.csproj -c Release -o nupkg/
Changelog
v3.0.0
- Upgraded to .NET 10 / C# 14 / Roslyn 5.0.0
- Delegate signature detection across all namespaces (
ParsedDelegaterecord) - Lambda and closure analysis: expression bodies, captured variables, owner resolution (
ParsedLambdaPropertyrecord) - 11 OS kernel lambda probes: kernel version, process info, CPU count, 64-bit flags, machine name, user, uptime, working set, GC memory, timezone, culture
- Self-verifier expanded to 32 checks across 6 categories (added OS Kernel Diagnostics)
GetKernelVersion()with OS-specific branches (Windows NT, Linux/proc/version, macOS Darwin)- 103 unit tests
v2.8.0
- Version display via
-v/--versionwith runtime, OS, and product metadata - Self-verification command (
verify) with 21 automated checks across 5 categories - Assembly SHA-256 integrity hash for reproducibility verification
- Roslyn dependency validation and runtime compatibility checks
- SecurityGuard invariant verification (protected extensions, path guards, timestamps)
- File system safety checks (system directory detection, path traversal)
- No access keys or credentials required — fully local verification
- 103 unit tests (10 new for self-verifier)
v2.7.0
- Intelligent
.gitignoregenerator with multi-ecosystem detection - 15+ project types: .NET, Node.js, Python, Rust, Go, Java, Ruby, PHP, Swift, Dart/Flutter, Unity, Terraform, Docker, Visual Studio, JetBrains
- Nested/hybrid project awareness (e.g., Node.js inside .NET, Python scripts in a monorepo)
- Safe merge mode with existing
.gitignore(append unique patterns only) - Custom pattern support via
--addflag - Preview mode via
--previewflag - SecurityGuard: path-based gitignore write validation
- 93 unit tests (22 new for gitignore generator)
v2.6.1
- Professional NuGet metadata and product page integration
- Comprehensive English documentation
v2.6.0
- Snapshot-based drift detection via
--from-reportcommand - Automatic
.snapshot.jsonserialization alongside text reports - SecurityGuard allowlist for tool-generated snapshot files
v2.5.0
- wwwroot static file comparison with SHA-256 content hashing
- Static file gap reporting (Section [4]) with file sizes and hash differentials
- CI/CD pipeline: CodeQL, SBOM generation, automated NuGet publishing
- Professional bilingual product page at sbay-dev.github.io/mvc-inspect
v2.4.0
.csprojand.slncomparison via--with-projflag- Package reference, project reference, and SDK property differentials
v2.3.0
--openflag for automatic report viewingopen <file>subcommand for existing reports
v2.2.1
- Timestamped auto-save filenames to prevent report overwriting
v2.0.0
- Razor view structural analysis (
.cshtml) @model,@inject,@section,asp-for,<partial>, ViewBag/ViewData extraction
v1.0.0
- Initial release — Roslyn-based C# structural inspection and gap analysis
License
MIT © 2025-2026 SBAY-SDK
| 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. |
This package has no dependencies.
v3.0.0: Upgraded to .NET 10 / C# 14 / Roslyn 5.0.0. Delegate signature detection and lambda/closure analysis with captured variable identification. OS kernel lambda probes (11 diagnostics). Self-verifier expanded to 32 checks across 6 categories. 103 unit tests.