---
title: "Install a C# desktop app in the Linux application launcher"
url: https://recursiveai.org/oneapp/cookbook/install-desktop-app-in-linux-launcher/
description: "Use the OneApp CLI to publish a C# app and add a Linux desktop entry for the current user, without sudo or a distribution package."
version: "1.1.1"
---

Add an app to the current user’s Linux launcher without `sudo`. On desktop, OneApp runs on [Linux (Wayland and X11), macOS (Apple silicon), and Windows](https://github.com/recursive-ai-oss/oneapp-csharp/blob/b93a90dc510817e92a4ebd1e340b83118461665c/README.md#L62-L68).

**1. Unzip the example and `cd` into the extracted folder.** It contains Desk Notes, a sample app with one heading.

**2. Install the CLI:**

```shell
dotnet tool install -g RecursiveAI.OneApp.Cli
```

Requires [.NET 10](https://dotnet.microsoft.com/download/dotnet/10.0) (net10.0); .NET 9 and earlier aren’t supported. If `oneapp` isn’t on your `PATH`, add `$HOME/.dotnet/tools`.

**3. Optional: preview the app.** Run `dotnet run` and close the window before continuing.

**4. Install the app:**

```shell
oneapp install . --no-aot
```

`--no-aot` skips native ahead-of-time compilation and publishes a self-contained managed build. On Linux, the project doesn’t need to reference OneApp, but it must publish a Linux executable and set `OneAppId`.

The install command prints JSON with `appId`, `version`, `dir`, `exec`, `desktopFile`, and `icon`. For this example it reports `"appId":"org.example.DeskNotes"` and `"version":"1.0.0"`. That’s the app version, not the CLI version.

Checked on Linux (X11): launching the installed entry opens a window and prints:

```text
Desk Notes opened.
```

## Full program

The zip’s `Example.csproj` pins OneApp and sets the launcher metadata:

```xml
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <OneAppId>org.example.DeskNotes</OneAppId>
    <OneAppName>Desk Notes</OneAppName>
    <OneAppCategories>Office;</OneAppCategories>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference
      Include="RecursiveAI.OneApp"
      Version="1.1.1" />
  </ItemGroup>
</Project>
```

```csharp
using OneApp;

var options = new AppOptions(
    "<h1>Desk Notes</h1>")
{
    AppId = "org.example.DeskNotes",
    Title = "Desk Notes",
    Width = 400,
    Height = 240
};
using var host = AppHost.Create(options);
Console.WriteLine("Desk Notes opened.");
host.Run();
```

Look for **Desk Notes** in the launcher. If `gtk-launch` is available, you can also open that entry by ID:

```shell
gtk-launch org.example.DeskNotes
```

If the CLI reports that `OneAppId` is missing, set it inside a `<PropertyGroup>` and run the install again. The zip already sets it.

## Variations

Remove the launcher entry and the installed files without deleting your project:

```shell
oneapp uninstall org.example.DeskNotes
```

## Related recipes

- [Build a desktop app with HTML and CSS in C#](https://recursiveai.org/oneapp/cookbook/build-desktop-app-with-html-css/)
- [Package a C# desktop app as a .deb or AppImage](https://recursiveai.org/oneapp/cookbook/package-dotnet-desktop-app-for-linux/)

## The short answer

Set a reverse-DNS `OneAppId` in the project file, then run `oneapp install . --no-aot`. OneApp publishes a self-contained managed build for Linux and writes a `.desktop` entry for the current user. You don’t need to build a `.deb` or install the app system-wide.

## How do I add an app to the Linux application menu?

The [Desktop Entry specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/) defines the `.desktop` file that the launcher reads. OneApp puts it in `applications/` under `$XDG_DATA_HOME`, or `~/.local/share` if that variable is unset. The `Name` key is what you search for in the launcher. The `Exec` key points at the published executable, not at `dotnet run` or a copy of the project. That’s why moving your source folder after installation doesn’t move the installed app.

Use the same `AppOptions.AppId` at runtime as `OneAppId` in the project. This lets the desktop associate the running window with its launcher entry. You can change the display name without changing the ID. Keep the ID stable when reinstalling an updated build; changing it makes a separate entry.

## Can you run .NET desktop apps on Linux without the SDK?

The SDK is needed to run the CLI and publish the project. The result from `--no-aot` includes the .NET runtime for the target so the launcher doesn’t need the SDK to open it. Self-contained doesn’t mean independent of Linux’s desktop or graphics services: the OneApp example still needs a supported graphical session and its system libraries. If you’re preparing an artifact to send to someone else instead of installing locally, build a distribution package or AppImage rather than copying the personal launcher entry, whose executable path is absolute.
