Windows Phone 8 template problem (2)

Rather than hijack someone else’s problem, which is separate from mine, but concerns the same template, I thought I’d create my own question.

Basically, I’m interested in create a MonoGame Windows Phone 8 project, and have installed MonoGame 3.2. I’ve tried the template from both Visual Studio 2013, and 2012, and get the same result.

When I start the project (no changes to any files) using debugging, and using a minimum spec phone emulator, I get a black screen, and not the corn flower blue I was expecting.

Curious to this, I tried setting a breakpoint in the Game1.cs’s Draw(x) method, and this was not getting hit.
So I added breakpoints to Update(x), UnloadContent(x), LoadContent(x), Initialize(x) and the constructor.

The constructor gets called, as does Initialize. I see the LoadContent call, and then nothing after that.
The emulator gives me a black screen with numbers for the framrate, etc. But that’s all.

Yet if I use a different template, such as the Windows game project, I get the corn flower blue.
Secondly, I tried downloading an example Windows phone 8 game, from here : Invasion game

it works in the phone emulator, no problems at all.

Any clues as to why this might be?

Does this thread help?

Absolutely! Thanks for for link!

So long as MiShu keeps that OneDrive file accessible, then others can benefit.
solution

MiShu is using NuGet to include MonoGame. But as I have MonoGame installed, I removed the NuGet package and referenced it localling. For me, it can be found here :

C:\Program Files (x86)\MonoGame\v3.0\Assemblies\WindowsPhone\x86\MonoGame.Framework.dll

The down-side to this, is that the assembly is specific to x86, and I’m assuming I’d need to change the reference when building for ARM. I’ll cross that bridge when I come to it. But basically, MiShu’s solution will work for any CPU.

So that raises a question : Why can’t the MonoGame libraries be built against “Any CPU” ? Wouldn’t that work? (aka, MiShu’s solution)

Right now, MonoGame projects for WP can’t be set to use “Any CPU” due to a missing language feature in C# for WP 8.0. You can read more details about this here. As a result, SharpDX (on which MonoGame is built) had to use a small piece of C++ code, and that could not be created for Any CPU. This means that two versions needed to be created, one for x86 and one for ARM, and so as you’re seeing, you need to manually switch your build configuration back and forth between the two.

That page linked above shows the issue as fixed for Windows Phone 8.1 with the missing language feature now available, so we should in time be able to get our projects running for Any CPU. I’m not sure if the SharpDX or MonoGame teams have taken advantage of this in their latest code yet, but it will presumably only work on WP8.1 anyway, which isn’t properly released yet, so it’ll still be a while until this is ready I suspect…