Today I migrated my Shadow Monsters from MonoGame 3.7.1 to 3.8. I ended up having to create a new user profile to do it. It's because of a bug in MonoGame 3,8 where if there is a space in the folder name the content builder is in it breaks. I used my full name so there was a space.
After I had a working profile and could run a test game it was time to migrate. The recommended process is to create a new project then copy over your .csproj files. I ended up going a different route. I decide that because everything was in one project and I wanted to reuse the code in other projects to split the project in two. I created a new project. I added all of the GameStates from the old project to the game and replaced the Game1 class with that. I created a new .NET Library and added the NuGet Packaages for MonoGame.Framework.DesktopGL and MonoGame.Framework.Content.Pipeline because I use the intermediate serializer for some custom content. I then added all of the other .cs files to this project. I added a reference for the library to the project. Then I needed to fix the bugs from splitting the solution but I got it working.
I have a custom tool that I use for building sprites. I added that project to the solution but when adding a reference for the library Visual Studio complained that .NET 4.7.1 cannot reference .NET Core 3,1, which MonoGame 3.8 is built with. Fortunately there is a workaround that was introduced in Visual Studio 2017. That is a project can target multiple frameworks. This isn't a perfect solution because there are differences between the different frameworks but I got it to work by targeting Core 3.0 and Standard 2.0.
That was my adventure for today. I'm happy with the end result and look forward to working with MonoGame 3.8.
No comments:
Post a Comment