C# Solution Explorer Extension
A comprehensive VS Code extension that provides Solution Explorer functionality for .NET projects with file template support and code analysis features.
Features
NuGet Management

Advanced Search

Solution Explorer

- Browse .NET solutions (.sln files) with a familiar tree structure
- View projects, folders, and files in a hierarchical view
- Support for solution folders and nested projects
- Drag and drop functionality for moving files
Code Analysis

Unused Symbol Highlighting
The extension automatically detects and highlights unused properties, methods, and fields in C# files by:
- Instant Feedback - Uses C# language server diagnostics for immediate response (same speed as IDE0051 warnings)
- Visual Indication - Unused symbols are greyed out with reduced opacity
- Hover Information - Hover over unused symbols to see detailed information about why they're marked as unused
- Real-time Analysis - Updates instantly as the C# analyzer detects changes
- Configurable - Customize the opacity level and toggle the feature on/off
- Smart Detection - Public methods are excluded from unused detection (they might be API endpoints or library methods)
- Performance Optimized - Primary analysis uses language server diagnostics, with fallback to reference checking
Supported Symbol Types:
- Properties (public and private)
- Methods (private only - public methods are excluded)
- Fields (public and private)
- Events (public and private)
File Templates

Right-click on any project or folder in the Solution Explorer to access the "Add -> New Item" menu with the following templates:
C# Templates
- Class - Creates a new C# class file
- Interface - Creates a new C# interface with proper naming (IInterface)
- Enum - Creates a new enumeration
- Record - Creates a new C# record type
Web Development Templates
- Controller - Creates an ASP.NET Core API controller
- Razor Page - Creates a new Razor page (.cshtml) with its code-behind file (.cshtml.cs)
- Razor Component - Creates a new Blazor component (.razor)
Testing Integration
The extension provides comprehensive test support through the VS Code Testing API:
Native Test Explorer - Tests appear in VS Code's built-in Test Explorer
Automatic Discovery - Automatically finds test projects and methods using MSTest, xUnit, and NUnit
Hierarchical Organization - Tests organized by Project → Namespace → Class → Method
Run and Debug - Run or debug individual tests, classes, or entire projects
Real-time Results - See test results with detailed error messages and stack traces
File Navigation - Click on any test to jump to its source code
Test Framework Support - Supports MSTest, xUnit, NUnit, and ASP.NET Core testing

Configuration Templates
- JSON File - Creates a new JSON configuration file
- XML File - Creates a new XML file
- Config File - Creates an appsettings.json style configuration file
Smart Features
- Automatic Namespace Generation - Templates automatically generate appropriate namespaces based on folder structure and project context
- Icon Support - All file types display with appropriate icons from the extensive icon library
- File Name Validation - Ensures valid file names and prevents conflicts
Usage

- Open a workspace containing a .NET solution (.sln file)
- The Solution Explorer will automatically appear in the Explorer panel
- Right-click on any project or folder to see the "Add" context menu
- Select "New Item" to access file templates
- Choose your desired template and enter a file name
- The file will be created with appropriate content and opened in the editor
Requirements
- Visual Studio Code 1.100.0 or higher
- A workspace containing .NET solution files (.sln)
Extension Settings
Include if your extension adds any VS Code settings through the contributes.configuration
extension point.
Feature Previews
Below are visual previews of the main features:
For example:
Configuration
The extension can be configured through VS Code settings:
Code Analysis Settings
csharp-dev-tools.editor.highlightUnusedSymbols
: Enable/disable unused symbol highlighting (default: true
)
csharp-dev-tools.editor.unusedSymbolOpacity
: Opacity level for unused symbols, from 0.1 (very faded) to 1.0 (normal) (default: 0.5
)
Solution Explorer Settings
csharp-dev-tools.solutionViewer.trackActiveFile
: Automatically reveal and select the active file in the Solution Explorer (default: true
)
csharp-dev-tools.solutionViewer.collapseOtherPaths
: When tracking active file, collapse all other expanded paths (default: false
)
Commands
The extension provides the following commands accessible via the Command Palette (Ctrl+Shift+P):
C# Solution Explorer: Toggle Unused Symbol Highlighting
- Toggle the unused symbol highlighting feature on/off
C# Solution Explorer: Open Extension Walkthroughs
(Alt+W) - Open the extension walkthroughs to learn about all features
Known Issues
- Reference analysis may take a moment for large files
- Some symbols may not be detected correctly if the C# language server is not fully initialized
Release Notes
0.0.1
Initial release featuring:
- Solution Explorer with drag & drop support
- Comprehensive file templates for C# development
- Unused symbol highlighting with configurable visual feedback
Following extension guidelines
Ensure that you've read through the extensions guidelines and follow the best practices for creating your extension.
Working with Markdown
You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
- Split the editor (
Cmd+\
on macOS or Ctrl+\
on Windows and Linux).
- Toggle preview (
Shift+Cmd+V
on macOS or Shift+Ctrl+V
on Windows and Linux).
- Press
Ctrl+Space
(Windows, Linux, macOS) to see a list of Markdown snippets.
Enjoy!