Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a .app mono bundle for Mac OS

Tags:

c#

mono

bundle

I am trying to create a .app bundle of my mono program to run on Mac OS X, but despite having read virtually all articles and documentation on macpack and bundling mono, none of the methods work.

Using macpack the binaries are bundled successfully in a .app package:

macpack -m:x11 -o:. -r:sqlite3.dll -r:Nini.dll -r:extraIcons.ini -r:APP_DATABASE.db3 -r:APP_Values.db3 -r:./Documents/manual.pdf -r:GemBox.Spreadsheet.dll -r:Mono.Data.SqliteClient.dll -a:APP.exe -n:APP

. When I try to start the program from the package this happens:

FFMACM-2:MacOS dev$ open -a APP
LSOpenURLsWithRole() failed for the application /Users/dev/Workspace/Software/APP.app with error -10810.

I tried using this method but the script fails with the following error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Nini, Version=1.1.0.0, Culture=neutral, PublicKeyToken=691faec150a7fa7b' or one of its dependencies.
File name: 'Nini, Version=1.1.0.0, Culture=neutral, PublicKeyToken=691faec150a7fa7b'
  at APP.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 
logout

I am fresh out of ideas. The Nini.dll is where it should be. I am using GTK# for the GUI.

like image 756
Kiril Avatar asked May 02 '11 22:05

Kiril


1 Answers

Creating a package for MacOS X is now done using MonoMacPackager. You can find details here http://www.mono-project.com/MonoMacPackager.

However, the issue that you're seeing here is that you're missing your dll (The Nini assembly) from your package. It needs to be in your application path (after it has been bundled) to load properly.

like image 129
lkg Avatar answered Nov 03 '22 06:11

lkg