roslyn:find_unused_code
Identifies unused types, methods, properties, and fields in your .NET project or solution, highlighting code with zero references to eliminate dead code.
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 |
|---|---|---|---|
| maxResults | No | Maximum results to return (default: 50, helps manage large outputs) | |
| 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) |