.NET 5 with MonoGame's DesktopGL

With .NET 5 release yesterday, I started testing my personal projects by switching their TargetFramework tag from netcoreapp3.1 to net5.0.

I have a playground game in Monogame using the DesktopGL template and after switching the target framework to .NET 5, it worked like a charm. Is it safe to assume that Monogame is compatible with net5.0, though?

In case someone finds this post in their search:

I’ve got a reply from @harry-cpp saying that there’s nothing to be done in MonoGame to start using .NET 5 other than just changing the target framework.

So, in my case, all I had to do was changing the *.csproj file like the following:

< PropertyGroup>
< OutputType>WinExe< /OutputType>
< TargetFramework>net5.0< /TargetFramework>
< /PropertyGroup>

3 Likes

Assuming you don’t want your game on other platforms.

1 Like

What is missing today for MonoGame to work on other platforms (Linux, iOS) using net5.0?

There have been new releases since December 2020, I’m not sure the discussions found while searching for monogame + .net 5 are relevant anymore.

Is there a roadmap somewhere of the work still to be done to achieve that goal ?

(Basically, to create a cross-platform application, what is the most recent framework usable? And is there a new one on its way?)

You are not gonna port dotnet 5 games to consoles anytime soon.

Like Martenfur said, consoles don’t support net5.0 yet, nor do Android and iOS.
However, you can build MonoGame desktop apps for Windows (x86, x64, ARM, ARM64), macOS 10.13+ (x64), and Linux (x64, ARM, ARM64, etc).

This makes your games natively compatible with the Surface Pro X and future Windows ARM64 devices, and any Linux distros people might install on them too. In theory it should work on Raspberry Pi (ARM, ARM64) as well, though your game may not perform well on such embedded devices.

One more thing, if you’re using a Shared Project, the preprocessor directive for net5.0 is:
#if NET5_0

1 Like

If it helps, net6.0 is supposed to release in November with added support for Android and iOS.