I'm trying to create a simple program with MonoGame in Xamarin Studio 4.0.10 (build 5).
But when I try to load some textures using Content.Load
method, I receive an exception System.MissingMethodException
with a message
Method not found: 'MonoMac.AppKit.NSImage.AsCGImage'.
The actual lines of code I am using are:
protected override void LoadContent()
{
//some stuff here
Texture2D freezeTexts = new Texture2D[5];
for (int i = 0; i < 5; i++) {
freezeTexts[i] = Content.Load<Texture2D>("freeze"+i); // exception here
}
//some other stuff here
}
I did some googling and found out that this happens because of some API changes, which Xamarin Studio haven't yet implemented (at least that's what I understood). So my question is: How can I fix this problem?
You can compile monomac from the latest source, to bring the API up to date.
It's pretty straightforward - this blog has some good instructions.
EDIT
It seems you need to go back in time with monomac to get a version compatible with the current release of MonoGame (which is pretty old - 3.0.1 was released on March 6th 2013).
It might be better to compile MonoGame itself from source. I managed to do this by forking their repo and compiling the MonoGame.Framework.MacOS
solution.
Referencing the assembly this produces in place of the released MonoGame.Framework.dll
allows my test app to build and launch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With