Monogame on Mac

Hi!

I tried to get a game that I wrote for Windows to run on Mac. I manually had to create a Xamarin.Mac application and installed the MonoGame.Framework.MacOS package.

Everything builds fine but I get a MissingMethodException on Game.Initalize.

Any pointers to what I need to do?

Thanks in advance

// Johan

System.MissingMethodException

Method ‘OpenTK.Platform.MacOS.MonoMacGameView.set_Size’ not found.

at Microsoft.Xna.Framework.MacGamePlatform.EnterFullScreen () [0x0005c] in <22537961847f41f881e1a9d3cb0e99a8>:0
at Microsoft.Xna.Framework.Game.applyChanges (Microsoft.Xna.Framework.GraphicsDeviceManager manager) [0x00030] in <22537961847f41f881e1a9d3cb0e99a8>:0
at Microsoft.Xna.Framework.Game.Initialize () [0x00007] in <22537961847f41f881e1a9d3cb0e99a8>:0
at Spacealot.Windows.SpacealotGame.Initialize () [0x00007] in /Users/johankarlsson/Repos/Spacealot/Spacealot.Mac/SpacealotGame.cs:105
at Microsoft.Xna.Framework.Game.DoInitialize () [0x00032] in <22537961847f41f881e1a9d3cb0e99a8>:0
at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior runBehavior) [0x00033] in <22537961847f41f881e1a9d3cb0e99a8>:0
at Microsoft.Xna.Framework.Game.Run () [0x0000c] in <22537961847f41f881e1a9d3cb0e99a8>:0
at Spacealot.Mac.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x0000c] in /Users/johankarlsson/Repos/Spacealot/Spacealot.Mac/AppDelegate.cs:21
at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[])
at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /Users/builder/data/lanes/5489/1bda16aa/source/xamarin-macios/src/AppKit/NSApplication.cs:100
at Spacealot.Mac.Program.Main (System.String[] args) [0x0001e] in /Users/johankarlsson/Repos/Spacealot/Spacealot.Mac/AppDelegate.cs:44

Hi.

I came across the same problem and failed to fix it for a long time. But finally the next trick helped me. Open Mac project’s settings, then on the Build -> General tab switch the Target Framework from Xamarin.Mac Modern to Full. This will require to remove current Monogame package and download a new one from the Nugget Gallery.

Hope this will help.
Cheers.

1 Like