Unused Methods Analyzer
Unused Methods Analyzer is a Visual Studio 2026 extension from Crestnova that helps C# developers find methods with zero meaningful static references and remove reviewed methods safely in batches.
Why use it?
Unused code increases maintenance cost, makes code navigation harder, and can hide obsolete behavior. This extension provides a solution-wide view of methods that appear to have no incoming source references, so developers can review and clean up dead code from one place.
Features
- Analyzes C# projects across the loaded solution.
- Finds methods with no meaningful static source references.
- Reports private, internal, public, protected, protected internal, and protected private methods.
- Treats recursive self-calls as non-usage when determining incoming references.
- Detects references across documents and projects.
- Handles interface contracts by pairing an unused interface member with its source implementation or implementations.
- Supports selecting one or more results for batch deletion.
- Selecting either side of an unused interface contract deletes the interface declaration and its validated implementations together.
- Opens a method’s source declaration from the results list.
- Supports filtering, sorting, multi-selection, progress reporting, and cancellation.
- Applies deletion atomically: if any selected method is stale or unsafe, the batch is rejected without editing the solution.
How to use
- Open a C# solution in Visual Studio 2026.
- Select Tools > Unused Methods Analyzer.
- Select Analyze solution in the tool window.
- Review the results and inspect any method by double-clicking its row.
- Select one or more methods.
- Choose Delete selected… and confirm the proposed changes.
- Review the resulting source-control diff before committing.
Deletion safety
Before applying a batch, the extension verifies that:
- The source document has not changed since analysis.
- Each declaration still occupies the expected source span.
- Each symbol still has the expected fully qualified identity.
- The methods remain ordinary, non-generated, non-attributed, non-partial, non-extern declarations.
- Overrides are not deleted automatically.
- Interface declarations and their implementations are validated as one deletion group.
- A fresh solution-wide reference search finds no incoming source reference outside the selected interface pair.
The operation is all-or-nothing. If validation fails for one selected item, no method in the batch is removed.
Important limitations
Static analysis cannot detect every runtime use. Reflection, dependency injection conventions, serializers, XAML binding, native entry points, generated code, and consumers outside the loaded solution may use a method without an ordinary C# source reference.
Public and protected methods are therefore presented for review, and users should inspect every proposed deletion. The extension analyzes ordinary named C# methods; constructors, accessors, operators, local functions, Visual Basic code, and runtime-only call paths are outside the current scope.
Compatibility
- Visual Studio 2026 and compatible Visual Studio 17.x API versions.
- C# projects using Roslyn workspace services.
- VSIX version 0.1.4.
Privacy
The extension performs analysis against the currently loaded Visual Studio solution. It does not send source code or analysis results to a remote service and does not include telemetry.
Publisher
Published by Crestnova.