I created a new Windows Phone 8 MonoGame project in Visual Studio 2013. After that, I run the following command in the Package Manager Console:
PM> Install-Package MonoGame-Portable
Then, I clicked on the Windows Phone Emulator to run my project, but it’s not working. I always get the following error messages:
using MonoGame.Framework.WindowsPhone;
The type or namespace name ‘Framework’ does not exist in the namespace ‘MonoGame’ (are you missing an assembly reference?)
The type or namespace name ‘MonoGame’ could not be found (are you missing a using directive or an assembly reference?)
_game = XamlGame.Create(“”, this);
The name ‘XamlGame’ does not exist in the current context
What is wrong?
How can I use the portable version of MonoGame?
Ok, just posted the answer on your log on the portable git site, but copying here for completeness:
Ok, simple step instructions (which obviously shows the failings in my article if it’s hard to follow)
1: Create a new MG project
2: Create a new Class Library (portable) project to your solution
3: Install the MonoGame.Portable NuGet into the new Class Library (portable)
4: Reference the new Class Library (portable) from your MG project
5: Add your game code to the Class Library (portable) project except for GAME
6: Replace the game class or update it with your game class code. add using references to the Class Library (portable) where needed.
And you should be up and running. to add another platform, just repeat steps, 1, 3 and 6
If you want to go a step further, you can abstract your game class in to the Class Library (portable) and just call Update and Draw from the MG game class.
Hope this helps
I’ll see to publishing a better walk through and sample for using the Portable MonoGame