-
-
Notifications
You must be signed in to change notification settings - Fork 334
Publishing your app
Publishing your app can be quite different depending on the OS you're publishing to.
Simply compile your Wpf or Winforms project in the IDE of your choice, or compile it with dotnet build
from the command line.
Compiling for Windows can only be done from Windows. Mac and Linux are unable to compile Wpf / Winform projects.
Simply compile your Gtk project in the IDE of your choice, or compile it with dotnet build
from the command line.
Please keep the following notes in mind:
- If you compile from Windows, due to NTFS not supporting executable file bits, users will first have to mark the application as executable. This can either be done via a command line with
chmod +x MyApp.Gtk
, or by right-clicking -> Properties -> Permissions -> Mark as executable. - On distros using GNOME as their DE (Ubuntu, Fedora etc.) your icon will not be displayed unless you provide a .desktop file along with it. For details on how to write one, consult the following documentation pages:
- Users will have to install dependencies to run your program first. This includes: the .NET Core runtime version of the project you're using or mono if you're using .NET Framework,
gtk3
,webkitgtk
,openssl
,icu
andlibappindicator
. The latter 5 should be preinstalled on most distros, but this isn't a guarantee.
NOTE FOR DEBIAN USERS: Debian 11 "bullseye" removedlibappindicator
from their package repos, and their alternativelibayatana-appindicator
currently does not work with Eto. They can circumvent this by going here to either installlibappindicator
from there or follow the instructions listed there to add the "buster" repos to their package manager - If you want to package the dependencies with your app, you have a few choices:
-
Create distro-specific packaging formats.
- For .deb's (Debian and Ubuntu based) packages, you can consult this guide: https://www.internalpointers.com/post/build-binary-deb-package-practical-guide
Note that you likely need different .deb files for Debian and Ubuntu, due to them having different package names - For .rpm's (Red Hat based) packages, you can consult Red Hat's documentation: https://www.redhat.com/sysadmin/create-rpm-package
- For .deb's (Debian and Ubuntu based) packages, you can consult this guide: https://www.internalpointers.com/post/build-binary-deb-package-practical-guide
-
Create a universal packaging format:
- For AppImage, a one file click-and-run distribution method, see their guides here: https://github.com/AppImage/AppImageKit/wiki/Bundling-.NET-Core-apps
- For Flatpaks, a sandboxed environment for your application, install-able via a package manger, consult their guide here: https://docs.flatpak.org/en/latest/first-build.html
Note that on Linux it's preferred to not have duplicate dependencies. So while universal packaging formats with .NET Core bundled might be tempting, try to create distro-specific package formats that specify .NET Core as a dependency if it's possible. Unfortunately, this isn't always possible as some distos (Debian or Ubuntu for example) don't have it in their package repos.
-
Simply compile your Mac project in the IDE of your choice, or compile it with dotnet build
from the command line.
If you use a Xamarin.Mac or a Eto.Platforms.macOS
project, it can only be compiled from MacOS.
It is worth noting, that for a Eto.Platforms.macOS
project you need to ensure the following:
- That you have the macos dotnet workload installed. If you don't, you can install it via
dotnet workload install macos
. - That your project's output type is
Exe
and notWinExe
as it otherwise won't compile - That your project's TFM has a
-macos
suffix (i.e.net6.0-macos
) - That your RID is set to
osx-x64;osx-arm64
if you want to support both Intel and M1 Macs - That your project's
csproj
contains aSupportedOSPlatformVersion
attribute, which should be set to the same version as theLSMinimumSystemVersion
attribute in yourplist
file.
If you compile from Windows, due to NTFS not supporting executable file bits, users will first have to mark the application as executable. This can either be done via a command line with:
chmod +x MyApplication.Desktop.app/Contents/MacOS/MyApplication.Desktop
xattr -c MyApplication.Desktop.app
In order to distribute your apps to run on the Mac they should be code signed and notarized. Details on how to do that via command line are here for code signing and here for notarization. See #Mac-Code-Signing-and-Notarization page for more information.
You should also package your app in a .dmg or .pkg for distribution. This site has some good details on how to do that.
For Mac64 targets, it's recommended to publish your app as a self-contained application if you intend to have M1 support. For unified builds, single-file deployment is needed as well.