Note that there are some explanatory texts on larger screens.

plurals
  1. PONullReferenceException when creating instance of Game class (OpenTKGameWindow.Initialize)
    primarykey
    data
    text
    <p>I just installed xamarin and monogame on OSX I have tried to run a really basic demo project that works perfectly on windows. But I get the following error:</p> <p><img src="https://i.stack.imgur.com/D69P9.png" alt="enter image description here"></p> <pre><code>System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.Xna.Framework.OpenTKGameWindow.Initialize () [0x00000] in &lt;filename unknown&gt;:0 at Microsoft.Xna.Framework.OpenTKGameWindow..ctor () [0x00000] in &lt;filename unknown&gt;:0 at Microsoft.Xna.Framework.OpenTKGamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in &lt;filename unknown&gt;:0 at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in &lt;filename unknown&gt;:0 at Microsoft.Xna.Framework.Game..ctor () [0x00000] in &lt;filename unknown&gt;:0 at test.Game1..ctor () [0x00057] in /Users/remojansen/Desktop/test/test/Game1.cs:37 at test.Program.Main () [0x00001] in /Users/remojansen/Desktop/test/test/Program.cs:19 </code></pre> <p>There is nothing wrong about the code so I must be missing a DLL or something? Do you have any ideas about what could be missing?</p> <p>Thanks :)</p> <p><strong>[EDIT]</strong></p> <p>The disassembly shows a error in the second line:</p> <pre><code>00000155 callvirt IWindowInfo OpenTK.NativeWindow:get_WindowInfo () 0000015a ldnull 0000015b callvirt Object System.Reflection.PropertyInfo:GetValue (Object, Object[]) 00000160 unbox.any System.IntPtr 00000165 stfld 0000016a call GraphicsMode OpenTK.Graphics.GraphicsMode:get_Default () 0000016f ldarg.0 00000170 ldfld 00000175 callvirt IWindowInfo OpenTK.NativeWindow:get_WindowInfo () 0000017a newobj Void OpenTK.Graphics.GraphicsContext:.ctor (GraphicsMode, IWindowInfo) </code></pre> <p>I have also manually compiled OpenTK and when I run the examples they seem to work fine:</p> <p><img src="https://i.stack.imgur.com/3DlTI.png" alt="enter image description here"></p> <p>I guess the problem is in monogame, I installed monogame using the xamarin monogame project template.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload