"This MGFX is for an older release of Monogame..." How do I compile to MGFX version 10?

Hi all,

I’ve compiled a .fx file with MGCB Editor, and am recieving this error (“This MGFX effect is for an older release of Monogame and needs to be rebuilt”) when I try to load it into my game, which uses the 3.8 source code.

The file’s header.Version is 9, while the MGFXVersion constant in the Effect class is 10;

I’ve tried lowering the MGFXVersion in the source to 9, but when I do so the BinaryReader throws an EndOfStreamException and dies.

How do I compile to MGFX version 10?

Thanks for any help!

The effect needs to be compiled with the new version of MGFXC, which is in your MonoGame source folder under Tools/MonoGame.Effect.Compiler/

Just build the entire tools solution, it includes MGFXC.
You can then launch the newly built MGCB editor and build the effects manually, or, make sure to reference the newly built content pipeline properly for automatic building.

This thread contains some info on how to do the latter.