Add mono runtime to “Open With” menu in Ubuntu 14.04

After installing the mono package and monodevelop IDE you may want to easily execute your mono executable. If you have wine installed, executables may be executed through Wine, or maybe Ubuntu is opening your application with some other sort default application like the file archiver… And then you right-click the applicationĀ but mono is not in the “Open with” menu… Here is how we can add the mono runtime to the file right-click “Open with” menu!

  • Navigate to /usr/share/applications. Create the monoRuntime.desktop file:
    sudo touch monoRuntime.desktop
  • Edit the file:
    sudo vim monoRuntime.desktop
  • Enter following content and save+exit vim:
    [Desktop Entry]
    Version=1.0
    Encoding=UTF-8
    Name=Mono Runtime
    GenericName=.Net Runtime
    Comment=Execute .NET applications
    Exec=mono %F
    TryExec=mono
    Icon=monodevelop
    StartupNotify=true
    Terminal=false
    Type=Application
    MimeType=text/x-csharp;application/x-mds;application/x-mdp;application/x-cmbx;application/x-prjx;application/x-csproj;application/x-vbproj;application/x-sln;application/x-aspx;text/xml;application/xhtml+xml;text/html;text/plain;
    Categories=GNOME;GTK;Development;IDE;
    X-GNOME-Bugzilla-Bugzilla=Ximian
    X-GNOME-Bugzilla-Product=Mono runtime
    X-GNOME-Bugzilla-OtherBinaries=mono

Now go to your executable, right-click it and see the mono runtime application option appear:

monoruntime