MonoGame 3.8.1

MonoGame 3.8.1 is now available for all!

Hotfix notice: a hotfix has been released to fix some rough edges. Please make sure to use version 3.8.1.303 of both MonoGame and the Visual Studio extension.

It’s been the long haul, thank you for your patience. Thanks to all the contributors and community members who made this release possible! Even though this release bears a minor version number, it boasts 143 changes and fixes from 43 contributors.

To start using this release, please refer to the getting started documentation.

For existing MG users please read the what’s new section in the documentation then our migration guide to help ease the transition to 3.8.1.

The most notable change for existing users is that MonoGame will only support .NET 6 and Visual Studio 2022 moving forward. Prior versions are now considered deprecated. JetBrains Rider and Visual Studio Code are supported with this release, but will come with a limited debugging experience (especially when working with Android and iOS).

Also, the MGCB Editor is no more designed as a .NET global tool (and doesn’t need to be registered). It is now a project tool defined project templates (please make sure that you have a .config/dotnet-tools.json properly configured) which will be installed automatically. You can access it either via the CLI (dotnet mgcb-editor from within the project/solution folder) or by double-clicking a .mgcb file when the Visual Studio extension is installed (the mac extension need to be installed from downloading the mpack here).

As always the more detailed changes can be found in the change log.

Thanks again for supporting MonoGame!

43 Likes

Thank you for all your hard work! I’m so happy I can finally migrate everything over to .NET 6 now :smiley:

3 Likes

Was waiting for this as soon as I saw the previous thread get unpinned, keep the good times coming!

1 Like

I installed the VS extension, but I do not see any Monogame templates when I go to create a new project.

I am running Visual Studio 2022 version 17.2.6 on Windows 11 version 21H2.

The extension is listed as installed in the extension manager. I have tried restarting VS multiple times, restarting my computer and uninstalling and reinstalling the extension.

Repair your installation?

EDIT

You don’t see this at all?

2 Likes

Thanks. The Monogame templates appeared after reparing my VS installation.

The Windows DX template has errors that have to be resolved before it will build:

Severity	Code	Description	Project	File	Line	Suppression State
Warning	NETSDK1137	It is no longer necessary to use the Microsoft.NET.Sdk.WindowsDesktop SDK. Consider changing the Sdk attribute of the root Project element to 'Microsoft.NET.Sdk'.	mg381 test2	C:\Program Files\dotnet\sdk\6.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets	147	
Error	CS0104	'ButtonState' is an ambiguous reference between 'System.Windows.Forms.ButtonState' and 'Microsoft.Xna.Framework.Input.ButtonState'	mg381 test2	D:\Code\mg381 test2\Game1.cs	32	N/A
Error	CS0104	'Keys' is an ambiguous reference between 'System.Windows.Forms.Keys' and 'Microsoft.Xna.Framework.Input.Keys'	mg381 test2	D:\Code\mg381 test2\Game1.cs	32	N/A
Error	CS0104	'Color' is an ambiguous reference between 'System.Drawing.Color' and 'Microsoft.Xna.Framework.Color'	mg381 test2	D:\Code\mg381 test2\Game1.cs	42	N/A

2 Likes

Great news! Congratulations!!! :tada:

1 Like

Please check: Remove global usings from 3.8.1 nuget packages. · Issue #7848 · MonoGame/MonoGame · GitHub

2 Likes

:heart_eyes: :star_struck:

:partying_face: :partying_face:

1 Like

Great news!

4 Likes

Love it!

Just a few things to mention as a JetBrains Rider user transitioning from a 3.8.0 project.

This change made it so my project wouldn’t build, as it went from directly referencing the mgcb dll to the dotnet tool, which I didn’t have installed.

My workaround was to install it via cli:

dotnet tool install -g dotnet-mgcb

Which installed it to my ~/.dotnet/tools directory as mgcb.exe. Unfortunately, this is also not invoked correctly by the build script, because it is intended to be invoked directly, not prefaced by dotnet. See here for why.

To finally fix it I simply renamed the executable dotnet-mgcb.exe so it would be properly run. Not sure why I had to go through these steps, but hopefully this will be a help to any others running into this problem.

7 Likes

Congrats and thanks for all the hard work!

1 Like

Does anyone have a different recommendation for the template. Only the attached one loads for me and I tried repairing installing directly, and from Visual Studio.

2 Likes

The UWP one works for me… straight out of the box…

1 Like

We noticed a few hiccups in the release that we’re presently addressing, we’re hoping to release a hotfix soon.

For the time being, if you’re running into issues with either MGCB, the MGCB Editor, or running the templates, please verify those points:

  • If converting projects, please check this updated migration guide. It is not yet published to the documentation site but will be soon;
  • If you can’t build the templates, please disable implicit usings by changing this property to false <ImplicitUsings>false</ImplicitUsings>. MonoGame will be updated to remove this feature;
  • If double-clicking an .mgcb file from Visual Studio with the extension installed freezes Visual Studio, please launch the MGCB Editor through the CLI with dotnet mgcb-editor within your project directory instead. An update to the Visual Studio extension will be published to fix this freeze.
5 Likes

3.8.1.303 has been published. Please upgrade both your projects and Visual Studio extension to avoid issues.

2 Likes

Forgive my ignorance, I am getting the following error after making the changes…

Severity Code Description Project File Line Suppression State
Error MSB3073 The command dotnet mgcb /quiet /@:C:\Users\Charles Humphrey\source\repos\NemoKradXNA\StarLords\StarLords\Content\Content.mgcb /platform:Windows /outputDir:C:/Users/Charles Humphrey/source/repos/NemoKradXNA/StarLords/StarLords/Content/bin/Windows/Content /intermediateDir:C:/Users/Charles Humphrey/source/repos/NemoKradXNA/StarLords/StarLords/Content/obj/Windows/net6.0-windows/Content /workingDir:C:/Users/Charles Humphrey/source/repos/NemoKradXNA/StarLords/StarLords/Content/ exited with code 1. StarLords C:\Users\Charles Humphrey.nuget\packages\monogame.content.builder.task\3.8.1.263\build\MonoGame.Content.Builder.Task.targets 142

I opened my old 3.8.0 in VS 2022, updated the packages to 3.8.1, set the TargetFramework in the project file for “net6.0” (but had to then set that to “net6.0-windows”, and now I get this build error.

What have I done wrong?

Thanks in advance…

1 Like

You might want to read the couple messages just before yours, it looks like your tests overlapped the hotfix release by a few seconds.

Package version in references and in .config/dotnet-tools.json should be 3.8.1.303

3 Likes

I updated to 303, and still get the error, but not updated dotnet-tools.json.

Just got off lunch, so will try that after work :slight_smile:

1 Like