Is MonoGame .Net Core only now, or am I just to stupid to find a .Net Standard template?
If I create a new Project from the “MonoGame Windows Desktop Application (Windows DirectX)” template, it’s always targeting .Net Core and I can’t change it.
Maybe I’m just dumb, or I don’t get it. But is there some inherent adventage to limit Monogame to .NetCore other than multi platform? Especially for the windows only directX template?
I’m sorry, I sound kind of annoyed right now, but I’m trying to port over my like a 1000 work hours projekt to 3.8 and it’s not a smooth transition so far…
Migrating from 3.7.1 to 3.8 is not an easy process. As far as I can tell 3.8 is built on .NET Core 3.1. You can use multi-targeting though if you edit the .csproj files manually and target .NET Standard and .NET Core 3.1. That said, .NET Core is supposed to be the new cross platform standard, for now.
Right-click your .csproj file (not the .sln file) and you will see the text:
You can replace netcoreapp3.1 with netstandard2.0 or netstandard2.1, but both will fail to build, they’re apparently not supported by the new MonoGame. However, if you want to have an output build similar to MonoGame 3.7.1’s, replace it with net452, like so:
This is the closest you can get to the old .NET 4.5 output from 3.7.1, as net45 and net451 will also fail to build. This is what I will be using for my own project to continue supporting Vista Service Pack 2 and keep my game size small without having to include the 100+ MB of .NET Core DLLs. This solution should work, if it doesn’t let me know.
Edit: By the way, instead of #if WINDOWS || LINUX, you can now use #if NET452 to target code for both WindowsDX and DesktopGL. If you need to only export to one or the other, call the new MonoGame.Framework.Utilities.PlatformInfo.MonoGamePlatform.ToString(); and use if-statements to check if the user is on Windows or DesktopGL (both are string values).
Not sure why it is a problem. Yeah I know it sucks switching your projects but… DotNet Core lets you compile really easy on other platforms (with one command) without having to create three version of your same game without #IF regions. Also it makes it easier on the ppl updating Monogame since the whole system is one code base. Also .Net is also moving towards core because the performance is better than on normal .net.