Skip to content

Publishing your app

Alexei Vinidiktov edited this page Mar 8, 2023 · 6 revisions

Publishing your app can be quite different depending on the OS you're publishing to.

Publish for Windows

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.

Publish for Linux

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 and libappindicator. The latter 5 should be preinstalled on most distros, but this isn't a guarantee.
    NOTE FOR DEBIAN USERS: Debian 11 "bullseye" removed libappindicator from their package repos, and their alternative libayatana-appindicator currently does not work with Eto. They can circumvent this by going here to either install libappindicator 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:

Publish for Mac

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 not WinExe 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 a SupportedOSPlatformVersion attribute, which should be set to the same version as the LSMinimumSystemVersion attribute in your plist 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.