Modernizer.Cli
1.0.0
dotnet tool install --global Modernizer.Cli --version 1.0.0
dotnet new tool-manifest
dotnet tool install --local Modernizer.Cli --version 1.0.0
#tool dotnet:?package=Modernizer.Cli&version=1.0.0
nuke :add-package Modernizer.Cli --version 1.0.0
Modernizer
A free, open-source CLI tool that scans .NET Framework solutions and generates an HTML migration report — how much effort it would take to move to .NET 8+.
It uses Roslyn to analyze your actual code, not just project files. ~70 detection rules. Runs fully locally — nothing leaves your machine.
Quick Start
dotnet tool install -g Modernizer.Cli
modernizer analyze path/to/YourSolution.sln
The report is written to ./out/report.html. Open it in any browser.
Requirements: .NET 8 SDK or runtime. MSBuild must be available (install Visual Studio or the .NET SDK).
What It Detects
| Category | Examples |
|---|---|
| System.Web / ASP.NET | HttpContext, HttpRequest/Response, Session, Cache, Server.MapPath |
| WCF Services | ServiceContract, OperationContract, service endpoints in config |
| ASMX Web Services | WebService, WebMethod attributes |
| WebForms | Page, UserControl, GridView, code-behind files, .aspx/.ascx/.master |
| MVC 5 | OutputCache, ChildActionOnly, Html helpers, legacy filters, AuthorizeAttribute |
| Web API 2 | ApiController, HttpResponseMessage, legacy route config |
| Entity Framework 6 | DbContext, EDMX, ObjectContext, lazy loading, ObjectSet |
| NHibernate | ISession, SessionFactory, HQL, Criteria API |
| OWIN / Katana | IAppBuilder, Startup class, UseOwin middleware |
| Threading | Thread, ThreadPool, Mutex, non-async blocking patterns |
| Serialization | BinaryFormatter, SoapFormatter |
| Platform APIs | Registry, COM Interop, System.Drawing, AppDomain, .NET Remoting |
| Configuration | ConfigurationManager, WebConfigurationManager, app.config patterns |
Usage
modernizer analyze <path-to-sln> [options]
Options:
--out <dir> Output directory (default: ./out)
--include <csv-globs> Only scan projects matching these name patterns
--exclude <csv-globs> Skip projects matching these name patterns
--redact-paths Hash all file paths in the report (safe to share)
--strip-snippets Omit code snippets from findings
--max-degree <n> Max parallel projects (default: CPU count / 2)
--timeout-seconds <n> Per-project timeout
--json-only Skip HTML report, write JSON artifacts only
--report-scanned-only Restrict report to scanned projects (respects filters)
--salt-hex <HEX> Fixed redaction salt (for reproducible path hashes)
Examples:
modernizer analyze My.sln
modernizer analyze My.sln --include "*Web*" --exclude "*Tests*"
modernizer analyze My.sln --redact-paths --out ./report
modernizer analyze My.sln --max-degree 4 --timeout-seconds 120
Output
The tool writes to --out (default ./out):
| File | Contents |
|---|---|
report.html |
Self-contained HTML report (inline CSS/JS, no external deps) |
findings.json |
All findings as structured JSON |
inventory.json |
Solution inventory (projects, WCF services, etc.) |
telemetry.json |
Per-project scan durations |
errors.json |
Any warnings or partial failures during scan |
logs/scan.txt |
Detailed scan log |
Effort Estimates
The report estimates migration effort in hours using a model with:
- Per-finding rates based on rule type (e.g.
System.Web.HttpContextis 2h first instance, 0.25h each additional) - Diminishing returns — the 50th occurrence of the same pattern costs much less than the first
- Per-project baseline of 3h for csproj conversion, NuGet updates, Program.cs, DI wiring, build, and smoke test
- Friction multipliers: 1.5× for moderate complexity patterns, 2.0× for high-risk ones
- WebForms patterns are flagged as "requires rewrite" and excluded from hour estimates — they don't fit the find-and-fix model
Sharing Reports Safely
If your codebase is sensitive, use --redact-paths to hash all file paths in the report. Paths are hashed with HMAC-SHA256 using a per-run random salt, making them non-reversible. An attest.txt file is written alongside the report recording the salt and tool version.
modernizer analyze My.sln --redact-paths
# or use a fixed salt for reproducible hashes across runs:
modernizer analyze My.sln --redact-paths --salt-hex YOUR_HEX_SALT
How It Works
- Load — Parses the
.slnfile and loads projects via MSBuild Workspaces (Roslyn). No compilation required. - Detect — Runs ~70 syntax-level and semantic detectors in parallel across all C# source files.
- Config scan — Separately scans
web.configandapp.configfor WCF bindings, HttpHandlers, HttpModules. - WebForms scan — Finds
.aspx,.ascx,.masterfiles and Razor helpers. - Effort model — Calculates migration hours using per-rule rates with diminishing returns.
- Report — Generates a self-contained HTML report and JSON artifacts.
An 87-project solution scans in ~30 seconds.
Building from Source
git clone https://github.com/AndrewMn123/modernizer
cd modernizer
dotnet build
dotnet run --project Modernizer.Cli -- analyze path/to/YourSolution.sln
To pack and install locally:
dotnet pack Modernizer.Cli -c Release -o ./nupkg
dotnet tool install -g Modernizer.Cli --add-source ./nupkg
Contributing
Issues and PRs are welcome. Some areas where contributions would be useful:
- New detection rules (open an issue describing the pattern + migration path)
- Improved effort estimates for existing rules
- Support for VB.NET projects
- Additional config file patterns (app.config, connectionStrings, etc.)
- Unit tests for detection rules
Please open an issue before starting a large PR so we can discuss direction.
License
MIT — see LICENSE.
| 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 was computed. 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 was computed. 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.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 38 | 3/18/2026 |