But I can’t get it to work. I can open the project, but it seems that the namespace “Microsft.Xna” does not exist. And MonoGame packages appear in the project reference list.
I have no idea how to fix it. Is it necessary to install MonoGame 7.1 in order to update the project?
Are you able to create and run a MonoGame 3.8 project before adding your existing code? As MrValentine asked how are you referencing MonoGame 3.8? Is your project targeting .NET Core 3.1? You shouldn’t need MonoGame 3.7.1 installed in order to upgrade. Instead of copying your .csproj files over try creating a new project and copying and pasting the code and content or use add existing item to add them.
The type of project was created with version 3.7 “MonoGame Windows Project” on .Net Framework 4.5.
Yes, I can create and run new 3.8 projects.
I can use this option to create new projects and move the code, but I have a few projects and I prefer to find a better solution.
For games I had to change the TargetFramework in the .csproj to netcoreapp3.1 because 3.8 targets .NET Core 3.1. In libraries you might need netstandard2.0. Without seeing the .csproj it’s hard to say what else needs to be changed.
Your csproj file uses the old outdated csproj format instead of the SDK format. You should consider creating a new csproj file from the monogame 3.8 template and just add your files in manually. You don’t have a lot of files so it shouldn’t take that long
Thank you very much, but it doesn’t work. Now when opening the project it gives an error: Visual Studio has had an unexpected problem that can affect some functions of the project system.
I wish there is more I could do to help you. There isn’t an easy way to do it. The architecture between the two projects is different. I’ve had to do it manually for all my projects by creating new projects and copy/pasting the files/content. It’s a pain and time consuming. I’m going to do some tests and try and make a migration tool.
Thanks Synammon, it would be great to have a migration tool. It would help beginners like me a lot. Above all, considering the number of examples and projects on the Internet for MonoGame 3.7.
Despite these migration issues, I think MonoGame 3.8 is a breakthrough. Congratulations to the development team.
To be honest, the best migration path with MonoGame 3.8 in my experience is simply to create the different MR projects your solution needs and just copy over the code.
Far easier in my experience, especially after updating all the MonoGame.Samples projects and a dozen other samples. You can simply get lost in the differences moving from a VS to .NETCore project type and it is simply cleaner to move code.
Might not be for everyone, but it takes me 5 mins max per project using the above method