Issue after re-porting game from Windows Store to WP8

I have just updated my WP8 application (was working on the Windows 8 build for 4 or so months) to all my latest source and assets.

After fixing all the expected issues and problems (power of 2 textures, shader instruction limits, vertex and pixel format support etc…) I have encountered a bit of a brick wall.

Inside DrawingSurfaceUpdateHandler.cs just after app start (before I can see the screen, after loading some content) I get a crash at “_synchronizedTexture.BeginDraw();” on line 144, in the function “public override void GetTexture(Size2F surfaceSize, out DrawingSurfaceSynchronizedTexture synchronizedTexture, out RectangleF textureSubRectangle)”

The error I get is

    A first chance exception of type 'SharpDX.SharpDXException' occurred in SharpDX.DLL
Additional information: HRESULT: [0x887A0001], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_INVALID_CALL/InvalidCall], Message: The application made a call that is invalid. Either the parameters of the call or the state of some object was incorrect.

After changing to a debug device and turning on native debugging I get

First-chance exception at 0x07D89997 in TaskHost.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x772059A3 (KERNELBASE.DLL) in TaskHost.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x772059A3 (KERNELBASE.DLL) in TaskHost.exe: 0xE0434352 (parameters: 0x887A0001, 0x00000000, 0x00000000, 0x00000000, 0x6E730000).

But I cannot seem to get any useful information out of that.

Anyone have any ideas?

I think the first error means that some DX call failed. Install DirectX11 SDK (included in Windows Platform SDK) and check the output window for errors from DX API when run in the emulator.

From the second error “0xC0000005: Access violation reading location 0x00000000” it looks like some resource is not initialized. Probably some texture and/or shader is not loaded correctly, missing from the .xap, or it’s in a format not supported by the device GPU. Setting the profile to Reach in the Game constructor might help you catch the later case.

I managed to get it to work by updating to nezzes public branch, it seems to be a monogame bug. The sample projects do it too.

I can’t figure out how to get monogame to work with a universal app.