如何在MacOS X上的Xamarin Studio中的Content.Load <Texture2D>中修复MissingMethodException?

Ant*_*nov 5 c# macos mono monogame xamarin-studio

我正在尝试使用Xamarin Studio 4.0.10(版本5)中的MonoGame创建一个简单的程序.但是当我尝试使用Content.Load方法加载一些纹理时,我收到一条System.MissingMethodException带有消息的异常

Method not found: 'MonoMac.AppKit.NSImage.AsCGImage'.
Run Code Online (Sandbox Code Playgroud)

我使用的实际代码行是:

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
}
Run Code Online (Sandbox Code Playgroud)

我做了一些谷歌搜索,发现这是因为一些API更改,Xamarin Studio尚未实现(至少这是我所理解的).所以我的问题是:我该如何解决这个问题?

The*_*man 6

您可以从最新的源代码编译monomac,以使API更新.

这非常简单 - 这个博客有一些很好的指示.

编辑

看来你需要回到monomac以获得与当前版本的MonoGame兼容的版本(这是相当古老的 - 在2013年3月6日发布3.0.1).

从源代码编译MonoGame本身可能更好.我设法通过分配他们的回购和编译MonoGame.Framework.MacOS解决方案来做到这一点.

引用此组件代替已发布的组件MonoGame.Framework.dll允许我的测试应用程序构建和启动.