Custom content loader "Invalid / Missing Importer" "Failed to create importer 'RoomContentImporter'"

Hello there,
I have been working on a little game and decided to make a custom content loader to load in level data. I have completed all the necessary parts for this (importer, processor, reader, writer) but cannot get the content pipeline to build the input file.

I have added the content pipeline extension as a reference in the properties of Content.mgcb but attempting to add a .room file and building fails. Attempting to set the Importer/ Processor properties on the file itself shows “Invalid / Missing Importer” (or Processor) and gives me no option to select my custom importer/ processor from the dropdown menu.

Since this was failing I attempted to manually edit the .mgcb file to point to the functions RoomContentImporter and RoomContentProcessor but still building does not work and I am greated by the message “Failed to create importer ‘RoomContentImporter’”.

I’m at a loss at what to do here, can anyone help me?

Code for the project can be found here if you are interested in taking a look yourself. https://github.com/tupto/Troid

I suspect that it is the same issue I have, here is the PR; https://github.com/MonoGame/MonoGame/pull/6566

I don’t know if this PR will be taken, but at least it fixes the problem for now for me. You just need to build pipeline and drop the custom bits in the monogame tools directory.

2 Likes

This seems likely since I’m using System.Runtime.Serialization - I’ll try building your solution tomorrow.

@timesscar
Hmmm still not working… Perhaps I’m doing something wrong though?

I cloned the MonoGame repo, built it to make sure it worked, merged your develop branch, built again, updated the references my project uses to point to the .dll files generated from my build, and finally opened my Content.mgcb file with the new Pipeline.exe. Still the same problem persists, and I remain unable to select an Importer or Processor for .room files.

EDIT: I updated the “Invalid / Missing Importer” text to read “Invalid / Missing Importer - send help” to confirm the correct program/build is being used and it definitely is. Something else is going on here.

Okay I’ve learned a little more since my last update. I believe timesscar’s pull request has helped in that I can see in the debugger that System.Runtime.Serialization is loaded. The problem now comes from the other important reference I’m using. The game project itself. It’s important I have a reference to this or there would be no Room class to use. The pipeline tool is attempting to load “Troid.dll” of course this doesn’t exist because the output of Troid is a .exe file.

I will now attempt a fix to allow loading “Troid.exe” instead but if I have no luck with that I will extract classes like Room into a new project “TroidEngine”.

I’m almost certain importing the Troid project as a reference to the Pipeline tool is not going to work as well as I initially suspected. I will move the bits I need out into an engine class library.

While researching I found a couple more people with similar problems and they came to the same conclusion. This really ought to be better documented.

Yeah that makes sense. The code is expecting a dll. Maybe move your game components to a dll and have your exe reference that.

EDIT: Just to note, if the only external type is System.Runtime.Serialization, your only issue may be having your importers in an .exe instead of .dll, since that is a GAC type and this issue only affects dlls that are not in the GAC.