UWP, Release vs. Debug, and the .NET Native tool chain...

Ok, trying this again.

My game (UWP) works in Debug Mode, both on Windows 10 and the Xbox One.
It works in Release mode, but only if I turn off the “.NET Native tool chain” compile option in the project properties.
It fails in Release mode with that same option turned on. The code compiles, but fails at runtime.

However, that option is needed to create an application package that will pass validation.

The part of my game that fails in Release mode is when I’m trying to load content from an XML file:

        Effects.SmokeBomb = Globals.ContentManager.Load<ProjectMercury.ParticleEffect>("Particles\\smokebomb");

This fails with an exception at runtime: System.IndexOutOfRangeException

Again, this line compiles and runs just fine in DEBUG and RELEASE (no .Net native toolchain) mode.

It appears to be related to the issue reported here: Custom Content Pipeline/serialization issues in Windows 10

… particularly the last post in the thread.

I’m pretty new here, but does this make sense to anyone?

After struggling with this for hours last night and today, it dawned on me that the XML was simply a list of instructions for how to set up my in-game object. Duh.

So rather than relying on the XML loading, I just copied the values out of my XML and created the objects by hand in code. Problem solved. Or worked around, at least.

The conflict still remains, as far as I can tell, between Monogame, .NET native tool chain, and loading content loading custom XML.