ReSharper for Visual Studio Code Help

Manage .NET Solutions and projects

As VS Code supports a wide range of languages and technologies, it does not use a universal concept of a project. Instead, it operates with workspaces, where a workspace is a directory (or a set of directories) that contains everything related to your current development task.

C# code, on the other hand, is typically organized into projects and solutions, with corresponding configuration files such as .csproj and .sln. If your workspace contains .sln, .slnx, or .slnf files, ReSharper for Visual Studio Code will help you open the associated projects and solutions in the dedicated RESHARPER SOLUTION EXPLORER node.

Manage .NET projects and solutions

To bridge the gap between a workspace and a project or solution in VS Code, you can use the directory where the .sln, .slnx, or .slnf file resides as the workspace.

In the current version, ReSharper for Visual Studio Code does not include a user interface for creating .NET projects or solutions. However, you can always use the .NET command-line interface (CLI) to create both projects and solutions. The .NET CLI is included in the .NET SDK, which you should already have installed

Open an existing solution

  1. Select File | Open Folder from the menu.

  2. Select the directory that contains the .sln, .slnx, or .slnf file for the target solution, and click Open Folder.

  3. Expand the RESHARPER SOLUTION EXPLORER node to browse the solution.

    ReSharper for Visual Studio Code: RESHARPER SOLUTION EXPLORER view

If there are multiple .sln, .slnx, or .slnf files in the directory you open, ReSharper for Visual Studio Code will help you choose the solution you want to work with. Expand the RESHARPER SOLUTION EXPLORER node, click Open Solution, and choose the solution from the list.

ReSharper for Visual Studio Code: Select a .NET solution from the directory

When you open the same directory with the several solutions for the second time, ReSharper for Visual Studio Code will automatically load the previously selected solution. To disable this behavior, disable the Solution: Auto Open Last Solution preference.

Create a new project and solution

  1. Select File | Open Folder from the menu.

  2. In the file browser, navigate to an empty folder where you want to store your code, then click Open Folder.

    This opens the selected folder as a workspace in the Explorer view.

  3. Select Terminal | New Terminal from the main menu or press ⌃ ⇧ ` to open the Terminal view.

  4. Make sure the command line is at the root of the workspace, and create a new project using a .NET project template. For example, to create a new console application named MyConsoleApp, run:

    dotnet new console -o MyConsoleApp

    This command creates a new MyConsoleApp directory containing the project configuration file MyConsoleApp.csproj and the initial source file Program.cs.

  5. Use the dotnet sln command to create a solution. For example, to create a solution named TestSolution, run:

    dotnet new sln --name TestSolution

    Then add the project to the solution:

    dotnet sln add MyConsoleApp
  6. In the Explorer view, expand the RESHARPER SOLUTION EXPLORER node and click Open Solution.

Manage projects and files in your solution

Add a new project via the command line

  1. Select Terminal | New Terminal from the main menu or press ⌃ ⇧ ` to open the Terminal view.

  2. Make sure the command line is in the root of the workspace, where the solution's .sln, .slnx, or .slnf file is located.

  3. Use dotnet project templates to create a project of the required type.

    For example, to create a class library named TestLib, run:

    dotnet new classlib -o TestLib
  4. To add the new project to the solution, use the dotnet sln add command:

    dotnet sln add TestLib

Add C# files

  1. To create a new file in a specific project or folder, select this project or folder in the RESHARPER SOLUTION EXPLORER node of the EXPLORER view and press ⌘ N or right-click and select Add....

  2. In the popup that opens, select the desired template and press .

  3. Tpe a filename with the .cs extension and press .

Install NuGet packages

  1. Select Terminal | New Terminal from the main menu or press ⌃ ⇧ ` to open the Terminal view.

  2. In the command line, switch to the directory that contains the .csproj file of the target project.

  3. Type the following command:

    dotnet add package <package.name>

    For example, to install the JetBrains.Annotations package, version 2025.1.0, type the following command:

    dotnet add package JetBrains.Annotations --version 2025.1.0

    For more information about the dotnet CLI, refer to Microsoft Docs.

23 May 2025