Monogame window is twice the size as it's supposed to be when run from Visual Studio in Debug

For a while when running the game window via the “Start” button in Visual Studio 2015 everything has worked fine. Recently the window size when running from the “Start” button in Debug mode the window is scaled up twice the size as it is supposed to be. This does not happen when running from “Start” in Release mode.

The viewport is still the same size as it’s supposed to be, but it’s stretched to fit the window. Clicking in the window doesn’t give me positions that match the viewport, so it’s a guessing game on where I’m actually clicking in the game.

Inside the “Game1” constructor I have this:

graphics = new GraphicsDeviceManager(this);
graphics.IsFullScreen = false;
graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;
graphics.PreferredBackBufferWidth = 1080;
graphics.PreferredBackBufferHeight = 1920;

I can’t find anything online related to it. What can I do to fix it?

Are you using Windows Scaling?

Are you on Windows 10?

Have you accounted for scaling factors?

Try 720p

I’m using windows 10. I’m using the windows text scaling since I am on a 4k screen. No matter what the resolution I put I still get the overscaled window.

So the text scaling could be the issue? I ONLY have the issue when running from the “Start” button in visual studio in debug mode. If I go to the bin/debug folder and run the *.exe file myself then it runs just fine with no scaling.

not text, resolution scaling…

I am using 4K with 150% scaling

Ah I see. I am also using 150% scaling. I didn’t realize there were two different settings for scaling.

Setting it to 100% fixes the issue. But it still doesn’t explain why it suddenly starting happening out of no where.

If I run the bin/debug/.EXE by double-clicking on it, then there is no scaling
If I run the bin/release/
.EXE by double-clicking on it, then there is no scaling
If I run with “Start” from VS in Release mode, then there is no scaling
If I hit CTRL + F5 to run without attaching while in Debug mode, then there is no scaling
If I run with F5 or “Start” from VS in Debug mode, then it scales. For the past two years, there have been no issues with this.

100% app scaling is just too small for me. I can’t read anything. So I can’t use that. I need to figure out how to fix it (assuming it’s not a bug in monogame).

1 Like

Basically it is about the DPI awareness, maybe this can explain a little?

Which version of MonoGame are you on, and which platform are you targeting?

Monogame version 3.7.1
Targeting Windows 10.

I followed the link that MrValentine posted and checked the dpiAware tag in my app.manifest. It was already there and set to true. So I changed it to false and tried with no change in the results. Then changed it back to true.