---
title: "Package a C# desktop app as a .deb or AppImage"
url: https://recursiveai.org/oneapp/cookbook/package-dotnet-desktop-app-for-linux/
description: "Package a OneApp desktop project for Linux as a Debian package or a standalone AppImage. See what each artifact contains and how users run it."
version: "1.0.0"
---

Use a `.deb` for APT installation or an AppImage to run without installing.

`oneapp package` doesn’t require the OneApp framework, but the project must publish a Linux executable and supply the package metadata.

```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.

```shell
oneapp package . --format deb
oneapp package . --format appimage
```

[The example](https://recursiveai.org/oneapp/cookbook/package-dotnet-desktop-app-for-linux/package-dotnet-desktop-app-for-linux.zip) is the full program below: unzip it and `dotnet run`.

In the unzipped project, `dotnet run` previews the Field Notes window; close it before running the two commands above from the same folder. Packaging runs on Linux. This project uses NativeAOT, so install the [.NET NativeAOT prerequisites for Linux](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/?tabs=net10%2Clinux#prerequisites) before you package it.

## Full program

The example uses the app host (`dotnet add package RecursiveAI.OneApp`). Here is `FieldNotes.csproj`, including the Linux package metadata:

```xml
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <PublishAot>true</PublishAot>
    <OneAppId>org.example.fieldnotes</OneAppId>
    <OneAppName>FieldNotes</OneAppName>
    <OneAppIcon>icon.svg</OneAppIcon>
    <OneAppMaintainer>Example Team &lt;team@example.org&gt;</OneAppMaintainer>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="RecursiveAI.OneApp" Version="1.0.0" />
  </ItemGroup>
</Project>
```

`icon.svg` is the launcher icon. It’s in the zip:

```html
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64">
  <rect width="64" height="64" rx="12" fill="#17544d"/>
  <path stroke="white" stroke-width="4" d="M16 22h32M16 32h32M16 42h22"/>
</svg>
```

`Program.cs`:

```csharp
using OneApp;

using var host = AppHost.Create(new AppOptions("<h1>Field Notes</h1>")
{
    Title = "FieldNotes",
    Width = 520,
    Height = 360,
});
host.Run();
```

On Linux x64 the two package commands wrote these files. These are the file names from their JSON `file` fields (without the machine’s absolute paths):

```text
fieldnotes_1.0.0_amd64.deb
FieldNotes-1.0.0-x86_64.AppImage
```

If packaging can’t read a required property, the tool returns a JSON error with a `code` and a `message`; for example, a `.deb` needs `OneAppMaintainer`, while an AppImage needs `OneAppIcon`.

## Variations

Put both artifacts in a staging folder instead of the current directory:

```shell
oneapp package . --format deb --output dist
oneapp package . --format appimage --output dist
```

## Related recipes

- [Show a confirmation dialog and toast](https://recursiveai.org/oneapp/cookbook/show-dialog-and-toast-with-ui-kit/)
- [Customize desktop dark mode and colors](https://recursiveai.org/oneapp/cookbook/theme-desktop-ui-kit/)

## The short answer

Use `oneapp package . --format deb` to make a package for Debian-style installation, or `oneapp package . --format appimage` to make one downloadable executable. Both commands publish the same project before building their respective artifacts. Keep a stable, reverse-DNS `OneAppId` to name the desktop entry and icon, and set `OneAppVersion` for releases; when omitted, it defaults to `1.0.0`.

## Should I distribute a .deb or an AppImage?

Choose a `.deb` when your users install software with APT. The package lays out the published files under `/usr/lib/<package>/`, provides a symlink in `/usr/bin/`, and installs a launcher entry and icon. The `Depends` field lets the package manager resolve dependencies available from the user’s configured repositories. To see the architecture and dependencies without installing anything, inspect the artifact:

```shell
dpkg-deb -f fieldnotes_1.0.0_amd64.deb Architecture Depends
```

Choose an AppImage when the user should be able to download one file and try it without installing a package. OneApp bundles an `AppRun` launcher, the program, a desktop file and the icon in the image. It doesn’t install a launcher entry when the user runs it. Neither format is signed by OneApp, and the command doesn’t upload either artifact.

## How do I run an AppImage on Linux?

Mark the file executable, then launch it. The usual launch mounts the image with FUSE:

```shell
chmod +x FieldNotes-1.0.0-x86_64.AppImage
./FieldNotes-1.0.0-x86_64.AppImage
```

On a machine without FUSE, use `./FieldNotes-1.0.0-x86_64.AppImage --appimage-extract-and-run` instead. The first time you *build* an AppImage, the tool downloads the pinned AppImage runtime and checks its SHA-256. Running the finished artifact doesn’t need that download.

## Will the package run on an older Linux distribution?

With NativeAOT, build on the oldest distribution you intend to support. The `.deb` records the minimum glibc version used by the published files, and bundling an app as an AppImage doesn’t remove that app’s glibc requirements. OneApp’s Linux desktop host also uses system libraries for Vulkan, Wayland or X11, and keyboard handling. Match the target architecture to the user’s system (`linux-x64` or `linux-arm64`). A cross-architecture build needs the corresponding native toolchain.

See [OneApp’s packaging reference](https://recursiveai.org/oneapp/docs/packaging/) for package properties and dependency detection.
