Porting a Game from XNA 4.0 to MonoGame 3.0 for Windows 8 Store

It’s fairly certain that Microsoft won’t be supporting XNA for non-Windows Phone platforms, so I decided to take some time to port my game to MonoGame. Just recently, the MonoGame team has released MonoGame 3.0 which includes full support for the Windows 8 Store. Follow these meager instructions to get yourself started with doing that. If you’re lucky like I was, there’s a chance that your code is almost a 100% carry-over to the MonoGame libraries.

  1. Download MonoGame 3.0 Installer
  2. Create New MonoGame Project for Windows 8 Store
    • Using Visual Studio 2012, create a new MonoGame project under Visual C# –> MonoGame –> MonoGame Game
  3. Manually Copy Code and Change References
    • Make sure MonoGame is referenced using the Windows 8 lib at C:Program Files (x86)MonoGamev3.0AssembliesWindows8MonoGame.Framework.Windows8.dll
    • Copy classes and files to the new project so that it mirrors the hierarchy of your XNA 4.0 project
    • Any libraries that are referenced which were compiled against the full .NET Framework will need to be recompiled against the .NET Core Framework (a subset of the .NET Framework that Windows Store Apps will reference)
    • Compile and fix any errors generated because of references to things that are no longer supported by Windows Store
    • Copy serialized .xnb files manually to the output directories of your MonoGame project (this is required because the Content Pipeline is not supported in Visual Studio 2012)

Some of the errors that I got were references to Close() method calls on streams (removed in .NET Core) and setting DTD validation on XmlStreams (also removed in .NET Core). See the link in the references section for an overview of the changes in .NET Core. Also, MSDN will have little green bag icons next to anything that is supported in the Window Store.

References:

http://msdn.microsoft.com/en-us/library/windows/apps/br230302.aspx

One thought on “Porting a Game from XNA 4.0 to MonoGame 3.0 for Windows 8 Store

Leave a Reply

Your email address will not be published. Required fields are marked *