A Visual Studio 2022 extension that extracts interfaces from C# classes and records with interactive member selection and customizable options.
Key Features
✨ Right-click to extract - Works directly from Solution Explorer context menu
✨ Interactive selection - Choose which methods, properties, events, and indexers to include
✨ Preview before saving - Review generated interface before writing to disk
✨ Smart defaults - Auto-suggests interface names with configurable prefix
✨ Batch processing - Handle multiple files at once
✨ Partial class support - Analyzes all parts of partial classes automatically
✨ Record support - Works with both classes and records
✨ Implementation stubs - Generate skeleton implementation classes
✨ XML documentation - Preserves XML comments from original members
Quick Start
- Right-click any
.cs
file in Solution Explorer
- Select Extract Interface...
- Review/edit the interface name
- Select members to include
- Preview and save
What's Supported
Types: Public classes, records, partial classes, and optionally internal types
Members: Methods (including generics), properties, events, indexers, and optionally operator overloads
Configuration
Customize behavior through Tools → Options → Interface Extractor:
- Interface folder name and namespace
- Automatic class updates
- File header templates
- Member sorting and grouping
- Implementation stub generation
Requirements
- Visual Studio 2022 (Community, Professional, or Enterprise)
For detailed documentation, examples, and troubleshooting, visit the GitHub repository.