Developer new to Monogame here, importing my project from XNA. Mostly it’s working, but when attempting to use pipeline.exe to import my xml data, I encountered the following error:
E:/extra programming/C# Projects/Outpost 0.2/Content/texes.xml: error: Importer 'XmlImporter' had unexpected failure!
Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Could not resolve type 'OutpostLibrary.Material[]'.
It’s pretty obvious that this comes up because the tool doesn’t know what the OutpostLibrary.Material type is. However I don’t know how to give it that reference.
There doesn’t seem to be any sort of “add reference” option anywhere. I tried adding the C# file that defines the class, but that didn’t help (actually it made MGCB crash so pretty sure that’s not the option to pursue).
I’m really not sure what else to try. I googled around but I couldn’t find anything on this topic.
Select the root node in the treeview. In the Properties window below, you will see a References property. This is where you add the path to your custom assembly.
1 Like
Thank you! That did it.
(I think, anyway - I’m getting another error, but I’m pretty sure it’s unrelated. Will follow up on this thread if it turns out it is relevant but for now I’m making a new one.)
Perhaps I am pointing at the wrong file (given that I have to type in the path by hand, it’s not impossible) but I am having problems with this solution.
My project is just a single Universal app (Windows 8 + Windows Phone) so the only assembly is the .EXE itself, which of course has several versions (debug / release, windows / phone) which leads to many issues.
- If I have MGCB GUI open, it holds on to a file handle to the .EXE, so I cannot actually build the project since I can’t overwrite the EXE.
- Obvious issues with pointing MGCB to one configuration’s file while I work on another configuration and the class definitions going out of date.
- If I close MGCB and then clean the project, I can’t build at all since the EXE does not exist (MGCB command-line build tool appears to run before the build operation) The only workaround appears to be to open MGCB GUI, remove the reference, remove all files that use the reference, rebuild the project, then re-add everything. I don’t really consider that a “solution”
Is there not a way that doesn’t involve pulling one’s hair out constantly?