roslyn:find_unused_code
Identify unused types, methods, properties, and fields in .NET/C# projects to remove dead code and improve maintainability.
Instructions
Find unused types, methods, properties, and fields in a project or entire solution. Returns symbols with zero references (excluding their declaration).
USAGE: find_unused_code() for entire solution, or find_unused_code(projectName="MyProject") for specific project. OUTPUT: List of unused symbols with location, kind, and accessibility. Default limit: 50 results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectName | No | Optional: analyze specific project by name, omit to analyze entire solution | |
| includePrivate | No | Include private members (default: true) | |
| includeInternal | No | Include internal members (default: false - usually want to keep internal APIs) | |
| symbolKindFilter | No | Optional: filter by symbol kind (Class, Method, Property, Field) | |
| maxResults | No | Maximum results to return (default: 50, helps manage large outputs) |