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.
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
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âŚ
Iâ am not familiar with the error, itâs just a guess.
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>
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)"
In the âJsonContentTypeWriterâ class, the âGetRuntimeReaderâ method returns âContentPipeline.Json.JsonContentTypeReader, ContentPipeline.Jsonâ. Isnât that correct?
Itâs looking for the âJsonContentTypeReaderâ class, with namespace âContentPipeline.Jsonâ in the assembly âContentPipeline.Json.dllâ. The error says that the class doesnât exist.
You need to revisit the tutorial before proceeding any further.
First get a working project by following the steps precisely. After that start applying your changes and test often. Use a versioning control system to revert back if something goes wrong.
Iâm sorry to bother you, but I cannot figure it out. I revisited the tutorial again, but itâs still broken.
I also added some more (unnecessary?) project references to force the compiler to build all dllâs, so they also exist in the bin folder now. But still the same error.
Please help me, I start to feel desperate.
I ran into the same problem as you did.
The solution for me was just to roll everything back to .net 6 because the content pipeline extension, for some reason, doesnât play nice with .net 8. Not the best way to solve it, but it works.
You can probably get away with setting only the extension to .net 6, but since mine was dependent on my other libraries, it wouldnât let me (they have to be on the same version).