Skip to content

Adding Existing Projects

Add existing .NET projects to your solution.

You can add projects that already exist on your file system to your solution, making them part of your workspace.

There are several ways to add an existing project:

  1. Right-click on the solution or a solution folder
  2. Select Add > Existing Project
  3. Navigate to the project file (.csproj, .fsproj, .vbproj)
  4. Click Open to add the project
  1. Open File Explorer (Windows) or Finder (macOS)
  2. Locate the project file (.csproj)
  3. Drag the file into the Solution Explorer
  4. Drop it on the solution or a solution folder
  1. Press Ctrl+Shift+P
  2. Type “C# Solution Explorer: Add Existing Project”
  3. Select the command
  4. Navigate to and select the project file

The extension supports all standard .NET project types:

  • C# Projects (.csproj)
  • F# Projects (.fsproj)
  • Visual Basic Projects (.vbproj)
  • Shared Projects (.shproj)

When you add an existing project:

  1. The project reference is added to the solution file
  2. The Solution Explorer refreshes to show the project
  3. All project files and dependencies are displayed
  4. NuGet packages are automatically restored
  5. Project references are resolved

To add multiple projects at once:

  1. Use the file picker to select multiple project files
  2. Hold Ctrl (Windows/Linux) or Cmd (macOS) while clicking
  3. All selected projects will be added to the solution

To add a project directly to a solution folder:

  1. Right-click on the solution folder
  2. Select Add > Existing Project
  3. Select the project file
  4. The project will be added to that specific folder

The extension uses relative paths when possible:

  • If the project is within the solution directory tree, a relative path is used
  • This makes the solution portable across different machines

If the project is outside the solution directory:

  • An absolute path is stored in the solution file
  • This may cause issues when sharing the solution across teams

Best Practice: Keep projects within the solution directory structure for better portability.

Once a project is added:

  • Build the project to restore dependencies
  • Set up project references if needed
  • Configure the startup project if applicable
  • Add NuGet packages as required

If you need to remove a project later:

  1. Right-click the project
  2. Select Remove Project from Solution
  3. The project files remain on disk but are removed from the solution

If a project doesn’t load properly:

  1. Check the Output panel for error messages
  2. Verify the project file is valid XML
  3. Ensure the project SDK is installed (e.g., Microsoft.NET.Sdk)
  4. Check that the target framework is installed

If the project loads but shows no files:

  1. Check the project file’s ItemGroup elements
  2. Ensure files are included in the project (not excluded)
  3. Try refreshing the Solution Explorer
  4. Check file system permissions

If you get a duplicate project error:

  1. The project may already be in the solution
  2. Check the solution file for duplicate entries
  3. Remove the old entry before adding again

If project references don’t resolve:

  1. Ensure all referenced projects are in the solution
  2. Check that target frameworks are compatible
  3. Restore NuGet packages for all projects
  4. Rebuild the solution