MonoGame for MonoDevelopor
MonoGame for Xamarin Studio.
colorsquare/sources directory. Note:
Total size: < 5 MB
apt-get install libmono-system-drawing4.0-cil mono-dmcs libopenal1 libsdl1.2debian libsdl-mixer1.2
Total size: approx. 16 MB for Mono, 0.5 MB for OpenAL, and 7.5 MB for SDL and SDL_mixer (on a slim Ubuntu Precise, with X.Org already installed)
cdinto the sources directory on the command line
dmcs -r:MonoGame.Framework.dll -target:winexe -out:colorsquare.exe *.cs
mcscompiler in Mono ≥ 2.11
If you choose to compile Mono from source, note that
starting with Mono version 2.11 a new unified compiler mcs is available. It replaces all previous runtime specific compilers. When using one of these recent versions, the compile command for the example sources (C# 4.0) is:
mcs -sdk:4 -r:MonoGame.Framework.dll -target:winexe -out:colorsquare.exe *.cs
If you hit a DllNotFoundException or TypeLoadException, double-check that you have installed all the required media libraries (SDL, SDL_mixer, and OpenAL) and copied all the MonoGame
*.config files to the same directory as
colorsquare.exe. If you're still having trouble, you can read more about what the
config files do (http://www.mono-project.com/DllNotFoundException), and then try running with more debugging information:
MONO_LOG_LEVEL=debug mono colorsquare.exe
The particularly tricky cases are when a DLL fails to load because one of the DLLs on which it depends can't be found. For example, if
OpenTK.dll is missing, the error message might look like:
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in <filename unknown>:0
MONO_LOG_LEVEL=debug exposes the real problem (OpenTK could not be loaded):
Mono: Assembly Loader probing location: '/colorsquare/OpenTK.exe'.
Mono: Assembly Loader probing location: '/usr/lib/OpenTK.exe'.
Mono: The following assembly referenced from /colorsquare/MonoGame.Framework.dll could not be loaded:
Assembly: OpenTK (assemblyref_index=2)
Public Key: bad199fe84eb3df4
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/colorsquare/).
If you move the MonoGame DLLs to a subdirectory, you will need to tell
mono where to find them.
MONO_PATH=/path/to/MonoGameLibs/ mono colorsquare.exe
Submit a comment or correction
|29 Jun 2013||Posted|