I am trying to bundle the application with mono 3.2.3 to a stand-alone executable. To do so, I am following this guideline. After declarating variables:
mono_version="3.2.3"
export MONO=/cygdrive/c/progra~2/Mono-$mono_version
machineconfig=$PROGRAMFILES\Mono-$mono_version\etc\mono\4.5\machine.config
export PATH=$PATH:$MONO/bin
export PKG_CONFIG_PATH=$MONO/lib/pkgconfig
export CC="i686-pc-mingw32-gcc -U _WIN32"
mkbundle --deps command cannot localize referenced assemblies:
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'gtk-sharp' or
one of its dependencies. The system cannot find the file specified.
File name: 'gtk-sharp'
performing exactly the same operation with mono 2.10.9:
mono_version="2.10.9"
export MONO=/cygdrive/c/progra~2/Mono-$mono_version
machineconfig=$PROGRAMFILES\Mono-$mono_version\etc\mono\4.0\machine.config
export PATH=$PATH:$MONO/bin
export PKG_CONFIG_PATH=$MONO/lib/pkgconfig
export CC="i686-pc-mingw32-gcc -U _WIN32"
mkbundle --deps --machine-config "$machineconfig" -c UI.exe
gives positive result:
OS is: Windows
WARNING:
Check that the machine.config file you are bundling
doesn't contain sensitive information specific to this machine.
Sources: 3 Auto-dependencies: True
embedding: C:userspiotrdesktopauthoringtoolUIindebugUI.exe
config from: C:userspiotrdesktopauthoringtoolUIindebugUI.exe.config
embedding: C:PROGRA~2MONO-2~1.9libmonogacgtk-sharp2.12.0.0__35e10195dab3c99fgtk-sharp.dll
embedding: C:PROGRA~2MONO-2~1.9libmonogacglib-sharp2.12.0.0__35e10195dab3c99fglib-sharp.dll
.
.
.
embedding: C:PROGRA~2MONO-2~1.9libmono4.0Mono.Posix.dll
Machine config from: C:Program Files (x86)Mono-2.10.9etcmono4.0machine.config
Compiling:
as -o temp.o temp.s
Does anyone know the reason of such behavior? I'm using 64-bit version of windows 7 and the Cygwin I found on the official website. The code was compiled and tested on Xamarin Studio 4.2 and Visual Studio 2010.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…