MonoGame 3.8.1

Excited for the update!

If anyone is in the same unique position as me, where you don’t use Visual Studio (and therefore cannot install the extension) and perhaps have a custom tool building content for you, I had to manually update the dotnet MGCB tools as such:

dotnet tool update dotnet-mgcb -g
dotnet tool update dotnet-mgcb-editor -g

Along with following the project upgrade suggestions in the main post, I was up and running again fairly quickly.

1 Like

dotnet tool update dotnet-mgcb -g
Tool ‘dotnet-mgcb’ was reinstalled with the latest stable version (version ‘3.8.1.303’).

dotnet tool update dotnet-mgcb-editor -g
Tool ‘dotnet-mgcb-editor’ was reinstalled with the latest stable version (version ‘3.8.1.303’).

mgcb-editor

System.IO.FileNotFoundException: Could not load file or assembly ‘PresentationFramework, Version=6.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. The system cannot find the file specified.
File name: ‘PresentationFramework, Version=6.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
at MonoGame.Tools.Pipeline.Styles.<>c.b__0_0(MenuBarHandler h)
at Eto.Style.<>c__DisplayClass13_01.<Add>b__0(THandler w) at Eto.DefaultStyleProvider.<>c__DisplayClass9_01.b__0(Object widget)
at Eto.DefaultStyleProvider.ApplyStyles(Object widget, String style)
at Eto.DefaultStyleProvider.Eto.IStyleProvider.ApplyStyle(Object widget, String style)
at Eto.Widget.OnStyleChanged(EventArgs e)
at Eto.Widget.set_Style(String value)
at MonoGame.Tools.Pipeline.MainWindow.PipelineMenuBar…ctor() in D:\a\MonoGame\MonoGame\Tools\MonoGame.Content.Builder.Editor\MainWindow.eto.cs:line 24
at MonoGame.Tools.Pipeline.MainWindow.InitalizeMenu() in D:\a\MonoGame\MonoGame\Tools\MonoGame.Content.Builder.Editor\MainWindow.eto.cs:line 287
at MonoGame.Tools.Pipeline.MainWindow.InitializeComponent() in D:\a\MonoGame\MonoGame\Tools\MonoGame.Content.Builder.Editor\MainWindow.eto.cs:line 60
at MonoGame.Tools.Pipeline.MainWindow…ctor() in D:\a\MonoGame\MonoGame\Tools\MonoGame.Content.Builder.Editor\MainWindow.cs:line 46
at MonoGame.Tools.Pipeline.Program.Main(String args) in D:\a\MonoGame\MonoGame\Tools\MonoGame.Content.Builder.Editor\Program.cs:line 50

What am I missing?

1 Like

try to reinstall the extension, restart VS - i was experiencing the same

1 Like

I am unable to build Effect (.fx files) in Visual Studio for Mac 2022.
Textures and other files registered in Content.mgcb build without problems.

Also, the error message in VS for Mac “dotnet mgcb …” command in the error message of VS for Mac and run it in the terminal, it builds normally.

Does anyone know the solution?

What we tried.

Rewrote /private/etc/paths.d/dotnet-cli-tools

~/.dotnet/tools to /Users/{username}/.dotnet/tools.

This seems to be a bug in the .NET SDK.

I deleted ~/.winemonogame.

I deleted .winemonogame from MonoGame 3.8.0 because it seems to not work properly if .winemonogame is left.

mv ~/.winemonogame ~/.winemonogame.bak

I tried re-installing mgcb and mgfxc.

Uninstall

dotnet tool uninstall dotnet-mgcb -g
dotnet tool uninstall dotnet-mgfxc -g

Reinstall

dotnet tool install dotnet-mgcb -g
dotnet tool install dotnet-mgfxc -g
1 Like

We strongly discourage installing tools with dotnet tool install and even more using the -g or --global parameters. This was the way to use MGCB back on 3.8.0 but we really discourage it with 3.8.1.

3.8.1 uses no-install local tools. If you use dotnet tool install with 3.8.1, you will break MonoGame’s installation and expose yourself to having MGCB version mismatching the one you use in your projects.

If you have a previous 3.8.0 installation, it is strongly recommended that you uninstall the global tools.

1 Like

Would it be possible to have an idiots guide to migrating the Content.mgcb file from 3.8.0 to 3.8.1?

I migrated my (cross platform) project as per the instructions (installed the VS2022 extension and changed to .NET6) but when I double click on Content.mgcb it opens in the 3.80 version of the editor.

I would like to be able to double click Content.mgcb and have it open in the latest editor.

Note: I very rarely use the command line in Visual Studio to install / uninstall or anything else.
I expect there are plenty more on here who also avoid it.

If you have a previous 3.8.0 installation, it is strongly recommended that you uninstall the global tools.
How is this done? (idiots guide please :upside_down_face:)

What needs to be done after that? I see mention that you just need to install the extension, but it’s not clear how that works - it appears to be just the project templates. Plus, I have it installed already and the old editor is being opened.

Thanks for your patience!!!
We are all in your debt :man_bowing:

2 Likes

The migration guide (read the .config/dotnet-tools.json carefully) + this should be enough (that part is needed if the wrong editor opens):

dotnet tool uninstall dotnet-mgcb -g
dotnet tool uninstall dotnet-mgcb-editor -g
dotnet tool uninstall dotnet-mgfxc -g
4 Likes

Thanks for the quick reply!!

I ran the 3 commands and the middle one performed the uninstall.

I wasn’t aware of the extra migration guide instructions you linked as they are not present here:
https://docs.monogame.net/articles/migrate_38.html

You might want to add it in there and also add the uninstall instructions perhaps.
Also, FYI: the point version in the json text is out of date due to the hotfix.

The editor now opens in the correct version.

My solution still doesn’t build but that’s my issue - its failing to load my Tiled maps so I guess something has broken the Tiled API.

1 Like

I linked it here. The updated migration guide isn’t online on the documentation site yet.

5 Likes

For some reason the file .mgcb file association didn’t happen when I installed the extension so I manually set it to run "C:\Users\username\.nuget\packages\dotnet-mgcb-editor-windows\3.8.1.303\tools\net6.0\any\mgcb-editor-windows-data\mgcb-editor-windows.exe", which works for now.

*(Not recommended). See below for better solution.

4 Likes

Something that confuses me… I see some users celebrating being able to use .NET 6 now, but… haven’t we already been able to do that? I’ve been using it for some time now in my current project. Or is that because I built it from source that I’ve been able to do that?

2 Likes

It was already possible for some platforms. Now it’s much more unified. (Also the pipeline was locked to .NET Core 3.)

The MonoGame repo is a lot cleaner too if you compare it with MonoGame 3.8.0 or even 3.7 one. I think the onboarding for new collaborators should be a lot more straight forward.

2 Likes

Before 3.8.1, MonoGame was a frankenstein kind of framework with different pieces requiring different .NET versions. Things are now much more smoother and future-proof.

The extension doesn’t associate files because the way .NET 6 works with tools doesn’t allow that, and by associating it manually, you’re pretty much opening yourself to future version mismatch.

7 Likes

My solution was a temporary botch. I’ve since changed it by right-clicking Content.mgcb in VS2022 and then Open With... and choosing MGCB Editor as the default. Didn’t seem to work yesterday but does now.

Awesome! I can’t wait to try this out! :slight_smile:

im trying microsoft upgade-assistant and its doing alot of this flawlessly so far…even updating netstardard libs with MG game stuff, to net 6 , and changes the monogame refs to the latest ones on nutget .

updating to mg 3.81 from 3.8 even if you are using netcore 6 already , can be a big deal for legacy projects. because Netstandard 2 is nearly dead, but Microsofts command line updgrate assistant does almost everything i did yesterday for me at least for vs 2022 preview slns. so I am trying that whch that almost ported my almosgt all of my wpf app to netcore 6 and Ill report if it works… it even updates your Monogame refs for you.

just run on cmd line

dotnet tool install -g upgrade-assistant
then donet tool upgrade-assistant analyze XXX.sln

then upgrade-assistant upgrade XXX.sln

when i targeted androind entry point,
it didnt not strip out the xaramin junk from the android target but warned me its unused.
but with a clean templayhte but i dont think xamarin is gone yet… as far as build and deploy its stiill slow…

as for MG and WPF legacy level editors , i hit a brick wall, but there is hope there as well. the wpf even wiht old docking and scripting libs, did port to netcore 6 and run, aboutg 99% was ok.

on a big legacy wpf and MG tooling rig and game , this looks like its an all or nothign deal for me … i cant link a 4.8 wpf exe to any netcore 6 libs so i cant run MG in wpf using net 6 game code in libs. and Netstandard 2.0 is quite nearly dead… but there is a compatibililty mode and some other ways around. but for my thing level editor WPF + monogame core… …last time i tried on vs 2019, the Compatibilly Analyser gave me a 99% so i went ahead with up and the WPF tool worked except for the monogame integration and a few details. …

ill try this again . the upside is there wpf level editor becomes mutliplatfrom. now that some parts work on the new MG. and see… if i can fix the sdl issue .

**Port from .NET Framework to .NET 6 - .NET Core | Microsoft Docs
but im going to Overview of the .NET Upgrade Assistant - .NET Core | Microsoft Docs

i think if this goes through i thnk should be mentioned as a way to update older MG projects all over the github that arent maintained because i just presse 1, and enter a bunch of times, diff and its doing what your guilde says to do and much more. could save someone days of work or worse, htting a brikc wall, havng to bail out and downgrade because of older dependencies. but i dont know about the maui, or the wpf, , ill halfway through it… jjust though id mention it now because thats how the front line approach should be done i think with any legacy code thats, should do this… at least on windows and vs 2022 mabye more… would have saved me a day…

1 Like

I had the same issue as you. i ran this command in the terminal and I now see all templates:

dotnet new --install MonoGame.Templates.CSharp
1 Like
  1. Add official source, command:
    dotnet nuget add source "https://api.nuget.org/v3/index.json" --name "NuGet official package source"
  2. Restart VS
  3. Update packages in Nuget Manager (change “official package source” on button right-up)
  4. Build and run
  5. Done

Thanks it works for me :+1:

hi,
I see an unexpected error
with MGCB editor
the build is functional with Android when I load the textures everything is fine
on the other hand on an Ios project it builds all green but I have this error
Microsoft.Xna.Framework.Content.ContentLoadException
The content file was not found.

1 Like