Content pipeline fails due to xml content

I am still working on the pipeline process. I have managed to get the pipeline and mgcb tools to behave consistently well and proceeding with my port of my XNA RPG to MonoGame.
I have managed to find a problem where the pipeline itself crashes with an attempted read beyond the bounds of an xnb file.
This problem fails even in step debug so is consistent but I have not managed to find out why it does not stop reading at the end of the xnb.
If I remove the part of the xml that is in process at the time the pipeline works and the game gets further along. If I adjust the map position of the item which is a PlayerNPC (which would join the Party if the user agrees) so that this Player is one map point earlier of the lead Players path I can step through the problem.
If I try to run it without stepping it fails with the same read attempt problem.
I am at a loss as to how to proceed.

Can you provide an example of an input file that’s failing? Are you working with XML files or something else that you’re feeding into the content tool?

The specific file is a map file Map001.xml
It is from the original XNA RPG toolkit.
I am not sure how to get a file uploaded as its not a jpg. etc.
Any free options available?

OK found a way.
Please see the file in this link.

The section that causes the problem is (Note formatting taken out)

          ContentName Nykkas  ContentName
           MapPosition 11 15  MapPosition
           Direction North  Direction

If replaced with an empty section

The content.Load works ok.

OK so more info. Stepping through I get am watching variable obj2 in line 164 of ReflectiveReaders.cs and just saw count=2 which was after seeing the details of JangElder and Ujar I was expecting the info for PlayerNpcEntries Item Nykkas what I see is a point with x and y = 2035156482 1935764331.
I have no idea where this info is coming from.

I don’t have much experience with loading XML through the MonoGame Content Pipeline, but I found that creating a new XML file with it looks like this:

<?xml version="1.0" encoding="utf-8"?> <XnaContent xmlns:ns="Microsoft.Xna.Framework"> <Asset Type="Object"> </Asset> </XnaContent>

The file you uploaded lacks the namespace in the XnaContent tag, which might be why it has trouble reading it. Try adding that and giving it a go.

Ok, thanks for that hint.
I have reworked all my input to the pipeline so they all comply with the standard.
There were and still are no errors reported in the pipeline or MGCB tools.
The problem I have is now at a point where I am in the content pipeline and specifically the InternalReader ReflectiveReader and during debug watching the stream counter as it is being read.
Form the Xml file I linked after the QuestNpcEntries after reading the Direction of “Ujar” I was expecting it to read a system object deliminiting the boundary between the Last QuestNpcEntry and the next Xml element which is the PlayerNpcEntries. What I see is an attempt to read an AnimatingSprite.
Screenshot is at

Anyone a pipeline ReflectiveReader specialist?

The Xml element in question is ok if I copy and paste it into another Xml file so am at a loss as to why this is happening. In fact if I copy it into the first map file the game progresses without the error and gets to the 3rd map so this is even more worrying.

Ok on trying to make progress I have accepted the problem in the 2nd map and tried to proceed through the 3rd map file. This has died at a similar point. The stream position is less than the total length but the last xml element has been processed and the xml location is back at the base Asset point so end of file. The content.load process continues and loads what should be a encoded int of a data type but ends up with something not recognised as its out of the range of the types list it has loaded for this process.
I am now suspecting that the xnb file is not formed correctly.
As all my problems seem to be coming from the pipeline and its handling of Xml I am wondering if I am a rare user of this part of MonoGame and so these sort of problem have not been seen before.

I don’t mind continuing but don’t want to waste the effort if its just for me.

So my question is now:

Does anyone use MonoGame for Xml processing or not?

I will hold until I get a response or my other work dries up and this becomes my only stuff to do.


This may be a bug in the pipeline for XML processing. Open an issue here, and they should be able to help you and diagnose the problem.

Ok issue 6215 has been raised in Git.