# Getting Started with Filtered Solutions Extension

## Overview

The Filtered Solutions Extension for Visual Studio 2022 is a productivity tool that automatically presents a project filter dialog when opening solutions with multiple projects. This allows you to work with only the projects you need, improving performance and reducing clutter.

## Key Features

✅ **Automatic filtering dialog** when opening multi-project solutions  
✅ **Smart dependency management** - automatically selects/deselects dependent projects  
✅ **Pattern-based filtering** with wildcard support (`*Test*`, `Core*`, etc.)  
✅ **Bulk selection operations** (Select All, Clear All, Select Tests)  
✅ **Tree view display** showing project dependencies  
✅ **Safe operation** - original solutions remain untouched  
✅ **Manual filtering** for already opened solutions  

## Installation

1. **Build the extension** or get the pre-built `.vsix` file
2. **Double-click** the `.vsix` file to install
3. **Restart Visual Studio 2022** if prompted
4. The extension is now active and ready to use

## How to Use

### Automatic Filtering (Recommended)

1. **Open a solution** using `File → Open → Project/Solution`
2. **Filter dialog appears** automatically for solutions with 2+ projects
3. **Select projects** you want to work with using checkboxes
4. **Dependencies are auto-selected** when you check a project
5. **Click "Create Filtered Solution"** to generate and open filtered solution
6. **Or click "Open All Projects"** to continue with the full solution

### Manual Filtering

1. **Open any solution** normally in Visual Studio
2. **Go to File menu** → "Filter Solution Projects..."
3. **Use the same dialog** to filter the currently opened solution
4. **Generate filtered solution** as needed

### Dialog Controls

#### Project Selection
- **Checkboxes**: Click to select/deselect individual projects
- **Auto-dependencies**: Dependencies are automatically selected when you check a project
- **Auto-dependents**: Dependents are automatically deselected when you uncheck a project

#### Bulk Operations
- **Select All**: Checks all projects in the solution
- **Clear All**: Unchecks all projects
- **Select Tests**: Automatically selects projects containing "Test" in their name

#### Filtering
- **Filter Pattern box**: Enter wildcard patterns to filter the project list
- **Examples**:
  - `*Test*` - Shows projects containing "Test"
  - `Core*` - Shows projects starting with "Core"
  - `*.Data` - Shows projects ending with ".Data"
  - `Web*` - Shows projects starting with "Web"
- **Clear button**: Removes the current filter

#### Tree View Features
- **Expand All/Collapse All**: Control dependency tree visibility
- **Project icons**: Visual indicators for different project types
- **Tooltips**: Hover for detailed project information
- **Selection counter**: Shows "X of Y projects selected"

## Understanding Dependencies

The extension automatically manages project dependencies:

- **When you CHECK a project**: All its dependencies are automatically checked
- **When you UNCHECK a project**: All projects that depend on it are automatically unchecked
- **Dependency tree**: Shows which projects reference others in a hierarchical view
- **Smart selection**: Ensures your filtered solution will compile successfully

## Examples

### Example 1: Working with Tests Only
1. Open your main solution
2. In the filter pattern, type: `*Test*`
3. Click "Select Tests" button
4. All test projects and their dependencies will be selected
5. Click "Create Filtered Solution"

### Example 2: Core Projects Only
1. Open your solution
2. Use pattern: `*Core*` or `*Infrastructure*`
3. Manually check any additional projects you need
4. Dependencies are auto-selected
5. Generate the filtered solution

### Example 3: Web Projects
1. Filter with: `*Web*` or `*API*`
2. Add any shared libraries you need
3. The extension ensures all dependencies are included
4. Work with a clean web-focused solution

## File Management

### Where Filtered Solutions Are Stored
- **Location**: System temp directory under `FilteredSolutions` folder
- **Naming**: `OriginalName_filtered.sln`
- **Safety**: Original solutions are never modified

### Custom Save Location
- Use **"Save As..."** button in the dialog
- Choose your preferred location
- Useful for creating permanent filtered solutions

## Tips and Best Practices

### Performance Tips
- **Start small**: Begin with just the projects you're actively working on
- **Use patterns**: Leverage filtering to quickly find relevant projects
- **Test projects**: Use "Select Tests" for focused testing sessions

### Workflow Suggestions
- **Feature work**: Filter to feature-specific projects + dependencies
- **Bug fixing**: Filter to affected projects only
- **Code review**: Filter to changed projects for easier navigation
- **Performance testing**: Create minimal solutions for faster builds

### Dependency Management
- **Trust auto-selection**: The extension correctly identifies dependencies
- **Check the tree**: Use Expand All to verify dependency relationships
- **Selection count**: Watch the counter to avoid over-selection

## Troubleshooting

### Dialog Doesn't Appear
- **Check project count**: Dialog only appears for solutions with 2+ projects
- **Verify installation**: Go to Extensions → Manage Extensions
- **Already filtered**: Dialog skips already filtered solutions

### Dependencies Not Working
- **Check project references**: Ensure projects have proper references in .csproj files
- **Solution dependencies**: Some dependencies are defined at solution level
- **Manual selection**: You can always manually select additional projects

### Filtered Solution Won't Open
- **Check paths**: Ensure all project files exist and are accessible
- **Dependencies**: Verify all required dependencies are included
- **Error messages**: Check Visual Studio output window for details

### Performance Issues
- **Large solutions**: Parsing 100+ projects may take time
- **Network drives**: Local solutions perform better
- **Clean temp**: Clear temp folder if accumulating many filtered solutions

## Advanced Features

### Pattern Matching
- **Case insensitive**: Patterns work regardless of case
- **Multiple patterns**: Use the filter iteratively to refine selection
- **Regex-like**: Uses wildcard patterns converted to regex internally

### Dependency Tree
- **Visual hierarchy**: See which projects depend on others
- **Expand/collapse**: Control detail level
- **Tooltips**: Rich information about each project

### Settings (Future)
The extension includes infrastructure for future configuration options:
- Auto-show preferences
- Remembered selections per solution
- Default filter patterns
- Custom project type handling

## Getting Help

### Debug Information
- **Output window**: Check Visual Studio Output → General pane
- **Log files**: Extension logs to temp directory
- **Error dialogs**: Extension shows clear error messages

### Common Issues
- **Missing projects**: Usually indicates dependency resolution issues
- **Build errors**: May need to manually include additional shared projects
- **Path issues**: Ensure project files haven't been moved since solution creation

## Version Information

- **Current version**: 1.0.0
- **Visual Studio**: 2022 (17.0+)
- **Target Framework**: .NET Framework 4.7.2
- **License**: CC0 1.0 Universal (Public Domain)

---

**Happy coding with cleaner, focused solutions!** 🚀

The Filtered Solutions Extension helps you stay productive by working with just the projects you need, while ensuring all dependencies are properly included.