2

I have developed Mono (.NET) application in Mac OS X and it runs from MonoDevelop just fine. Although, it fails with error when I run from command line like this:

mono SqlDynamiteX.exe

Instead, I have to run the application like this:

export DYLD_FALLBACK_LIBRARY_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib:$DYLD_FALLBACK_LIBRARY_PATH:/usr/lib"

exec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono ./SqlDynamiteX.exe

Then, I have made a Mac OS X app this way:

macpack -n:SqlDynamiteX -o:. -a:SqlDynamiteX.exe -i:WindowIcon.icns -m:winforms -r:SqlDynamite.Common.dll,SqlDynamite.Util.dll,Npgsql.dll,MySql.Data.dll

And I have edited Info.plist file inside package according to this post:

Setting environment variables in OS X?

<key>LSEnvironment</key>
<dict>
    <key>DYLD_FALLBACK_LIBRARY_PATH</key>
    <string>/Library/Frameworks/Mono.framework/Versions/Current/lib:$DYLD_FALLBACK_LIBRARY_PATH:/usr/lib</string>
</dict>

But the application still fails with error when I double-click it in Finder.

Could anyone help me with that issue?

Community
  • 1
  • 1
user306080
  • 1,409
  • 3
  • 16
  • 37

2 Answers2

2

Platypus application for Mac OS X could wrap the script so you don't need to modify Info.plist file.

user306080
  • 1,409
  • 3
  • 16
  • 37
1

Have you checked out Xamarin? It's made by the very makers of MonoDevelop, and I believe its settings are such that (like Platypus) handles the info.plist files better. I don't believe you'd go through the trouble you're presently going through to get your app compiled.

[Disclosure: I do not work for Xamarin and do not have a stake in their interests, I just think it'd help you out.]

daOnlyBG
  • 595
  • 4
  • 20
  • 49
  • Seems that Xamarin Studio uses regular `xbuild` for building, it doesn't have specific magic. I tried to build project template created with Xamarin Studio with xbuild and it works. Here are `.fsproj` and some other files from project template (but it's for F#, I don't know if it's different): https://gist.github.com/kolen/e2162f5c9122078c06ab70edc1abf139 – kolen Oct 12 '16 at 12:54