Skip to content

Multi-root Workspace Support

Work with multiple solutions and projects across different workspaces.

C# Dev Tools supports VS Code’s multi-root workspace feature, allowing you to work with multiple solutions simultaneously.

A multi-root workspace allows you to open multiple folders in a single VS Code window:

  • Each folder can contain its own solution
  • Each solution is displayed separately in the Solution Explorer
  • You can work across multiple solutions simultaneously
  • Settings can be configured per workspace folder
  1. Open a folder with a solution
  2. Go to File > Add Folder to Workspace
  3. Select another folder containing a solution
  4. Both solutions will appear in the Solution Explorer
  1. After adding folders, go to File > Save Workspace As
  2. Save the workspace file (.code-workspace)
  3. Open this file later to restore the multi-root workspace

When multiple solutions are open:

  1. Each solution appears with its workspace folder name
  2. Use the dropdown in the Solution Explorer to switch between solutions
  3. Each solution maintains its own state and context

You can build projects from different solutions:

  • Right-click any project and select Build
  • The build targets only the selected project
  • Dependencies are resolved within each solution

When running or debugging:

  1. Set the startup project in the desired solution
  2. Press F5 or use the debug controls
  3. The correct project will launch

You can configure settings per workspace folder:

  1. Open the workspace settings file (.code-workspace)
  2. Add folder-specific settings under folders[].settings
  3. Each solution can have its own:
    • Build configurations
    • Test settings
    • NuGet sources
{
"folders": [
{
"path": "project-frontend",
"name": "Frontend"
},
{
"path": "project-backend",
"name": "Backend"
}
],
"settings": {
"csharp-dev-tools.solutionViewer.autoLoad": true
}
}
  • Open multiple service solutions simultaneously
  • Work on shared libraries and services together
  • Test integration across services
  • Open frontend solution (e.g., Blazor)
  • Open backend solution (e.g., Web API)
  • Develop both simultaneously
  • Open application solution
  • Open shared library solution
  • Modify and test library changes immediately
  • Reduce context switching
  • See related projects side-by-side
  • Work on dependencies without switching windows
  • Test integration between projects
  • Run multiple applications simultaneously
  • Debug across solution boundaries
  • Reference code across solutions
  • Copy code between projects easily
  • Maintain consistency across codebases

Project references work best within a single solution. Cross-solution references may require:

  • NuGet packages for stable dependencies
  • Shared projects for code reuse
  • Relative path references (less portable)

Build dependencies are managed per solution:

  • Projects in different solutions may need manual build ordering
  • Use solution-level build configurations for complex scenarios
  • Group related solutions in one workspace
  • Use descriptive folder names
  • Keep workspace files in source control
  • Don’t open too many solutions (2-4 is ideal)
  • Close unused solutions to reduce clutter
  • Use solution folders to organize projects within each solution
  • Multiple large solutions may impact performance
  • Close solutions not actively being used
  • Adjust file watcher settings if needed

If solutions don’t load in a multi-root workspace:

  1. Check that each folder contains a .sln file
  2. Refresh the Solution Explorer
  3. Verify folder paths in the workspace file

If you’re unsure which solution is active:

  1. Check the Solution Explorer title bar
  2. Use the solution dropdown to verify
  3. Note the workspace folder name next to each solution

If builds fail in multi-root workspaces:

  1. Ensure project references are within the same solution
  2. Check NuGet package restoration
  3. Build solutions independently to isolate issues