JetBrains Fleet 1.10 Help

Manage .NET (C#) solutions, projects, and files

As Fleet supports a lot of different languages and technologies, it does not have a universal concept of a project, instead it operates with workspaces, where a workspace is a directory that contains everything associated with your current development task.

On the other hand, C# code is normally organized in projects and solutions, with corresponding configuration files (.csproj and .sln).

Manage .NET projects and solutions

To bridge the gap between workspace and project or solution in Fleet, you need to use the directory where the .csproj or .sln file resides as a workspace.

In the current version, Fleet does not have a user interface for creating projects and solutions, but you can use .NET command-line interface (CLI) for that. .NET CLI is included in the .NET SDK, which you should have installed as described in prerequisites.

Create a new project and solution

  1. Press ⌘O or select File | Open from the menu.

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

    This will open the desired folder as a workspace in the Files view.

  3. Press ⌘⌥T or choose View | Terminal from the menu to open the Terminal window.

  4. Make sure that the command line is in the root of the workspace, and create a new project from a dotnet project template. For example, we can create a new console application MyConsoleApp. To do so, type the following in the terminal:

    dotnet new console -o MyConsoleApp

    This command will create a new MyConsoleApp directory and place the project configuration file MyConsoleApp.csproj and an initial source file Program.cs in this directory.

  5. Use the dotnet sln command to create a new solution for your project. Let's call it FleetTestSolution. Type the following in the terminal:

    dotnet new sln --name FleetTestSolution

    To add the project to the solution, type

    dotnet sln add MyConsoleApp
  6. Now you can switch to the Files view to create and open project files from there.

Open an existing project or solution

  1. Press ⌘O or select File | Open from the menu.

  2. Select the directory that contains the .csproj file of the target project, .sln file of the target solution, or any of its parent directories and click Open.

When you first create or open a project or solution in JetBrains Fleet, you will see its file system structure in the Files view and have basic editor features as well as textual search.

When you enable the Smart Mode, JetBrains Fleet will analyze and index everything included in the solution, and you will be able to access tons of code intelligence features.

If there are several .sln files in the directory or that you open or its subdirectories, JetBrains Fleet will help you choose the solution you want to work with — after clicking the Smart Mode Status icon on the toolbar, click + in the popup and select the desired solution.

JetBrains Fleet: Select a .NET solution from the directory

Manage projects and files in your solution

JetBrains Fleet features a minimalistic lightweight user interface, but all project management tasks are easily available either from the terminal or from the editor.

Add a new project to the solution

  1. Press ⌘⌥T or choose View | Terminal from the menu to open the Terminal window.

  2. Make sure that the command line is in the root of the workspace, where the solution's .sln file resides.

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

    For example, to create a class library TestLib, type the following:

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

    dotnet sln add TestLib

Add C# files

  1. Do one of the following:

    • To create a new file in a specific project or folder, select this project or folder in the Files view and press ⌘N or right-click and select New File.... Then type a filename with the .cs extension and press .

      JetBrains Fleet: New C# file in the Files view
    • To create a new file next to the file currently opened in the editor, make sure that the focus is in the editor and press ⌘N or select File | New File... from the menu. Then type a filename with the .cs extension and press .

      JetBrains Fleet: New C# file in the editor
  2. Press and to choose the desired template for the new file and then press to select it.

    JetBrains Fleet: File templates in C#

Add references to other projects within the solution

  1. Use a type from a non-referenced project in your code. For example, if that project declares the class ArchiveFolder, you can type

    var archiveFolder = new ArchiveFolder();
  2. Set the caret to the name of the class, press ⌥↵, and choose Reference project...:

    JetBrains Fleet: Add project reference in C#
  3. This will add a new project reference and the corresponding using directive.

Install NuGet packages

  1. Press ⌘⌥T or choose View | Terminal from the menu to open the Terminal window.

  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, v. 2022.1.0 type the following command:

    dotnet add package JetBrains.Annotations --version 2022.1.0

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

Last modified: 25 November 2022