Recursive AI

Package a C# desktop app as a .deb or AppImage

OneApp is a free, open-source framework for desktop apps in .NET whose UI is HTML and CSS, drawn natively with no web view, from Recursive AI. MIT or Apache-2.0, no native DLLs to ship.

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.

Terminal
dotnet tool install -g RecursiveAI.OneApp.Cli

Requires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.

Terminal
oneapp package . --format deb
oneapp package . --format appimage

The example 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 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:

C#
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:

Terminal
oneapp package . --format deb --output dist
oneapp package . --format appimage --output dist

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:

Terminal
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:

Terminal
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 for package properties and dependency detection.

All oneapp recipes