WP8 Crashes / Black Screen

Hi there

i’m using MonoGame for WP8, but the Game doesn’t start. Only a black Screen shows up and the Code crashes after XamlGame.Create()

        public GamePage()
        {
            InitializeComponent();

            _game = XamlGame<MyCoolGame>.Create("", XnaSurface);

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }

I’m using the latest Developement Build (v3.2).

Try this:

public GamePage()
{
    InitializeComponent();

    _game = XamlGame<MyCoolGame>.Create("", this);

     // Sample code to localize the ApplicationBar
     //BuildLocalizedApplicationBar();
 }

(Sorry, I just realized its actually a word-joke: Try “this”. :smiley: )

haha :wink:

sorry my codesnippet was wrong, i already use …Create("", this)

I guess your MyCoolGame class looks like this :

public partial class MyCoolGame : Game
{ ... }

and also you have your “protected override void LoadContent()”, “protected override void Update(GameTime gameTime)” and other necessary methods in that class?

Yes of course, have a valid Game-Class (with protected LoadContent(), Update, etc. Methods)

i got a TypeLoadException

{System.TypeLoadException: Typename or Namespace was not found in metadata file. (Exception from HRESULT: 0x8000000F)
   at SharpDX.Direct3D11.D3D11.get_D3D11CreateDevice_()
   at SharpDX.Direct3D11.D3D11.CreateDevice(Adapter adapterRef, DriverType driver...

Have you installed monogame through an installer or through NuGet? Because as far as I know the 3.2.2 installer has wrong dlls, so they cause who knows what kind of errors. Try uninstall it and install the nuget version.
If that still does not help you, take a look at my code, it is working (contains a lot of test code, but that does not matter), maybe it will help you:

ok, found it. had to copy the File SharpDX.WP8.winmd to the MonoGame Assembly Folder.