MonoGame Content Pipeline Extension Errors

Hey guys,

I was following a tutorial to create a custom content pipeline extension ( MonoGame Content Pipeline Extension). After I add the new reference to the Content Manager, I cannot rebuild the content anymore due to the error in the screenshot.

That is the first thing I need to solve and I need help for :slight_smile: .

After I fiddled around a bit and solved it somehow, the JSON file I added is still not able to be imported.

You can find the code here: https://github.com/BanditBloodwyn/Grim-Veil.

What is the problem? Maybe my project structure or project names?

Hey @BanditBloodwyn
The error message is specifically about the TextureProcessor which is one of the built in types of the MGCB, not sure why it would throw an error when making a custom extension. Sometimes you’ll see error for the writers because they have a similar TInput signature as one of the built in writers, but not processors.

I tried looking at the code, but your link is invalid.

You may also want to post this over on the new GItHub discussion forums as the community forums here are moving there soon

Sorry, my mistake. I made the repository public, so you can check the code now :slight_smile:

I see that System.Runtime is version 8.0.
Did you build the extension for net8 ?
The executable content builder is net6. Try rebuilding the extension targeting net6.

That might or might not be it… :grinning:
I’ am not familiar with the error, it’s just a guess.

That was a guess of mine too. But unfortunately, it’s not the solution.

No one have an idea?

I believe the problem is here

look into \ContentPipelineExtension.Json\bin\
Do you see a monogame.framework.dll ? That is the DesktopGL build.
The pipeline is uses the WindowsDX build. There is a conflict of types when mgcb tries to load extensions DLLs.

You need to add <PrivateAssets>All</PrivateAssets>

as it is here.

Well no, this file is not there.

When I add this new line in the project file, I get this error message when I rebuild the content in the Content Manager:

Still the same as before.

What’s in the \ContentPipelineExtension.Json\bin\ folder? can you copy a list?

Remove everything other than the DLL of the extension itself, and then rebuild.

Here the content of the folder “Grim-Veil\ContentPipelineExtension.Json\bin”:

  • Debug
    • net8.0
      • ContentPipelineExtension.Json.deps
      • ContentPipelineExtension.Json.dll
      • ContentPipelineExtension.Json.pdb

That’s all.

Interesting.
At first I asked if you build the extension for .net8, you said no.
I see that this is not the case. Or did you change it to .net6 and then back to .net8?

Build the extension for .net6 ** AND ** keep the PrivateAssets set to All.

Hey yo!!! That was the solution to my initial problem, thanks a lot!

Now, when I run the program and try to load the JSON, I get the following error message:

Microsoft.Xna.Framework.Content.ContentLoadException: "Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: ContentPipeline.Json.JsonContentTypeReader, ContentPipeline.Json (ContentPipeline.Json.JsonContentTypeReader, ContentPipeline.Json)"

This is the line that triggers it:

_contentManager.Load<TileType>("JSON/TileTypes/tileType_dirt");

The path of the JSON itself should be correct.

In the “JsonContentTypeWriter” class, the “GetRuntimeReader” method returns “ContentPipeline.Json.JsonContentTypeReader, ContentPipeline.Json”. Isn’t that correct?