Opening Solutions
Learn how to open and manage .sln and .slnx files in VS Code.
Automatic Solution Detection
The Solution Explorer will automatically load the first .sln or .slnx file found in your workspace when you open a folder containing .NET projects.
Opening Multiple Solutions
If you have multiple solutions in your workspace:
- Click the Solution Explorer icon in the Activity Bar
- Use the dropdown at the top of the Solution Explorer to switch between solutions
- The active solution name will be displayed in the title bar
Supported Solution File Formats
Traditional .sln Files
The extension fully supports traditional Visual Studio solution files (.sln):
- Opening and parsing solution structure
- Managing projects and solution folders
- Editing solution properties
- All common solution operations
Modern .slnx Files
The extension also supports the newer XML-based solution format (.slnx):
- Simplified XML structure
- Better source control integration
- All functionality available with .sln files
Removing Projects from Solution
To remove a project from the solution:
- Right-click on the project in the Solution Explorer
- Select Remove Project from Solution
- Confirm the removal when prompted
Note: This removes the project reference from the solution file but does not delete the project files from disk.
Renaming Projects
To rename a project:
- Right-click on the project in the Solution Explorer
- Select Rename Project
- Enter the new project name
- The extension will update:
- The project file name (.csproj)
- The solution file reference
- The project folder name (if applicable)
- Assembly name and root namespace
Moving Projects to Solution Folders
Solution folders help organize related projects:
- Drag a project in the Solution Explorer
- Drop it onto a solution folder
- The solution file will be updated with the new organization
Alternatively:
- Right-click on a project
- Select Move to Solution Folder
- Choose an existing folder or create a new one
Creating Solution Folders
Solution folders are logical containers for organizing projects:
- Right-click on the solution or an existing solution folder
- Select Add > Solution Folder
- Enter a name for the folder
- The folder will appear in the Solution Explorer
You can nest solution folders to create hierarchical structures.
Drag & Drop Project Organization
The Solution Explorer supports drag and drop for easy reorganization:
- Drag projects between solution folders
- Drag projects to the solution root
- Drag solution folders to reorder them
- Nested drag and drop for complex hierarchies
The solution file is automatically updated to reflect your changes.
File Tracking
The Solution Explorer includes intelligent file tracking features:
Auto-Sync with File System
- Changes made outside VS Code are automatically detected
- New files added to projects are reflected in the tree
- Deleted files are removed from the view
- Renamed files update automatically
Active File Tracking
Press Shift+Alt+L
to reveal the currently open file in the Solution Explorer. The tree will automatically expand to show the file's location.
You can enable automatic tracking in settings:
- Open VS Code settings (
Ctrl+,
) - Search for
csharp-dev-tools.solutionViewer.trackActiveFile
- Enable the setting to automatically highlight the active file
Manual Refresh
If the Solution Explorer becomes out of sync with the file system:
- Click the refresh button in the Solution Explorer title bar
- Or use the command:
C# Solution Explorer: Refresh Solution Explorer
Closing Solutions
To close a solution:
- Close the workspace folder containing the solution
- Or open a different workspace
The Solution Explorer will clear and wait for a new solution to be opened.