Note that there are some explanatory texts on larger screens.

plurals
  1. POMonogame template crashes on launch with System.TypeInitializationException
    primarykey
    data
    text
    <p>Attempting to run this program on Windows</p> <pre><code>#region Using Statements using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Storage; using Microsoft.Xna.Framework.Input; #endregion namespace asdf { public class Game1 : Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public Game1() //Exception raised points to here { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.IsFullScreen = true; } protected override void Initialize() { base.Initialize(); } protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); } protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) { Exit(); } base.Update(gameTime); } protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); base.Draw(gameTime); } } } </code></pre> <p>Raises the following exception</p> <pre><code>Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---&gt; System.DllNotFoundException: /tmp/install/lib/libgdiplus.so at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&amp;,System.Drawing.GdiplusStartupInput&amp;,System.Drawing.GdiplusStartupOutput&amp;) at System.Drawing.GDIPlus..cctor () [0x000cc] in C:\cygwin\sources\mono\mcs\class\System.Drawing\System.Drawing\gdipFunctions.cs:127 --- End of inner exception stack trace --- at System.Drawing.Icon.get_Handle () [0x00020] in C:\cygwin\sources\mono\mcs\class\System.Drawing\System.Drawing\Icon.cs:646 at (wrapper remoting-invoke-with-check) System.Drawing.Icon:get_Handle () at OpenTK.Platform.Windows.WinGLNative.set_Icon (System.Drawing.Icon value) [0x00000] in &lt;filename unknown&gt;:0 at OpenTK.NativeWindow.set_Icon (System.Drawing.Icon value) [0x00000] in &lt;filename unknown&gt;:0 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 asdf.Program.Main (System.String[] arrayargs) [0x00000] in &lt; filename unknown&gt;:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---&gt; System.DllNotFoundException: /tmp/install/lib/libgdiplus.so at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&amp;,System.Drawing.GdiplusStartupInput&amp;,System.Drawing.GdiplusStartupOutput&amp;) at System.Drawing.GDIPlus..cctor () [0x000cc] in C:\cygwin\sources\mono\mcs\class\System.Drawing\System.Drawing\gdipFunctions.cs:127 --- End of inner exception stack trace --- at System.Drawing.Icon.get_Handle () [0x00020] in C:\cygwin\sources\mono\mcs\class\System.Drawing\System.Drawing\Icon.cs:646 at (wrapper remoting-invoke-with-check) System.Drawing.Icon:get_Handle () at OpenTK.Platform.Windows.WinGLNative.set_Icon (System.Drawing.Icon value) [0x00000]in &lt;filename unknown&gt;:0 at OpenTK.NativeWindow.set_Icon (System.Drawing.Icon value) [0x00000] in &lt;filename unknown&gt;:0 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 asdf.Program.Main (System.String[] arrayargs) [0x00000] in &lt;filename unknown&gt;:0 </code></pre> <p>When run in Mono.</p> <p>I have tried:</p> <ul> <li><p>Reinstalling Mono</p></li> <li><p>Reinstalling Monogame</p></li> <li><p>Reinstalling Xamarin Studio</p></li> <li><p>Updating windows</p></li> </ul> <p>and the error has remained unchanged.</p> <p>This error does not occur when using SFML.Net in place of monogame</p> <p>The whole solution can be found <a href="http://www.mediafire.com/?cvdvq32uw5uiwww" rel="nofollow">here</a></p>
    singulars
    1. This table or related slice is empty.
    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.
    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