Pipeline and XML Collections

Greetings,
I am trying to use Monogame instead of XNA completly for packaging content (mainly, because it’s a major pain to do so)
Pipeline.exe works pretty good with most of my test content XMLs, but one, it won’t swallow (XNA has no problem with it).

<?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
  <Asset Type="MyTypes.VisibleGameComponentTemplate[]">
    <Item Type="MyTypes.ButtonTemplate">
      <Name>Okay</Name>
      <ZOrder>100</ZOrder>
      <Texture>OKButton</Texture>
      <Box>200 10 200 50</Box>
    </Item>
[...]

I am guessing the problem is the MyTypes.VisibleGameComponentTemplate[] which is a base type to, for example MyTypes.ButtonTemplate.
The error I receive is the following

[...]/MenuButtons.Xml
[...]/MenuButtons.Xml: error: Importer 'XmlImporter' had unexpected failure!
System.ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: key
   bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   bei Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateSerializer.GetTypeSerializer(Type type)
   bei Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateReader.ReadObject[T](ContentSerializerAttribute format, ContentTypeSerializer typeSerializer, T existingInstance)
   bei Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateReader.ReadObject[T](ContentSerializerAttribute format)
   bei Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateSerializer.Deserialize[T](XmlReader input, String referenceRelocationPath)
   bei Microsoft.Xna.Framework.Content.Pipeline.XmlImporter.Import(String filename, ContentImporterContext context)
   bei Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
   bei MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent)

Sorry for the german exception message.

Is there anything I can do about it or are arrays of stuff not yet implemented?
Thanks,
Michael.

We just added the new IntermediateSerializer code 2 days ago:

So I would expect this to work now. You can either get the latest code from github or download one of the development installers to try it.

If it still doesn’t work then enter a bug report on GitHub for it with the example XML that won’t load. It should be easy for us to add a new test case and fix it.

1 Like

I just downloaded the new development installer this afternoon.
So I’ll refine a simple example xml for the bug report.
Thanks, you guys rock.

1 Like

Great… i’ll fix it as soon as it comes in.

1 Like

For anyone that comes across this thread later… it was fixed in https://github.com/mono/MonoGame/pull/2819.