MonoGame Game.Run() suddenly doesn't seem to do anything

When I attempt to run my game, game.Run() appears to be doing nothing. It doesn’t open a window and returns an error code of 0. I put some WriteLine()s to check whether the game starts, and they both get called and print… My game was working and I can’t figure what (if anything) I did to break it. I don’t even call Game.Exit() anywhere in my code.

public static void Main(string[] args)
{
	Console.WriteLine("GAME START");
	var game = new Game();
	game.Run();
	Console.WriteLine("GAME END");
}

I’m running the latest MonoGame 3.8, Windows, and it’s a WindowsDX project.

OK, the problem thickens. I switched from referencing the WindowsDX MonoGame to DesktopGL which somehow got my game working again, only to make it so I can’t set the window size? Again, working before. Using PreferredBackBuffer*.

take a look at this thread: (3.8 release) Can't change window size.

Thanks for your help, it works now! Any idea why WindowsDX broke and why I can’t change window size in the constructor? Should I open two issues on Github?

i have no idea. You should ask the devs, or maybe indeed open issues on Github. But nice to hear that it works now :slight_smile:

You can’t change window size in the constructor because the GraphicsDevice is only instantiated between calling the constructor and calling the Initialize method of the game class.

It does work but you are doing it wrong. It runs off a tick for starts. use this:

main:

static void Main(string[] args)
{
     using(var game = new App())
          App.Run();
}

App.cs:

public class App : Game
{
    public App()
    {
         graphics = new GraphicsDeviceManager(this);
    }
}