System.Exception: 'This MGFX effect was built for a different platform!'
ggiraudon opened this issue · 4 comments
I'm trying to build a project using GeonBit.UI from source.
I have successfully build and executed the project on one computer, but after commiting the code to a git repository and pulling it from another computer, I am no longer able to run the application.
The build steps work out just fine and the content pipeline builds properly as well.
However, when my code reaches :
UserInterface.Initialize(GameContent, BuiltinThemes.hd);
an exception is throw in Ressources.cs (in the GeonBit.UI project) at the line :
DisabledEffect = content.Load(_root + "effects/disabled");
The exception is :
System.Exception: 'This MGFX effect was built for a different platform!'
I've tried deleting all obj and bin folders accross the solution in order to force all the code and contents to be rebuilt.
I've also tried using Debug and Release versions of the DataTypes.dll pipeline extension as well as building the whole solution in both Debug and Release.
No luck so far.
I am pretty sure that the MonoGame and Visual Studio versions on both computers are identical.
Any idea of what I might have missed ?
I think you may have a problem with building effects on the second machine (is it linux?).
Do you have your own Sprite effects that you can validate if working?
Thanks,
Hi Ronen,
No, both machines are Windows and I don't have any effects appart from the ones in the content imported from GeonBit.UI
My solution is a cross platform MonoGame using a shared project for most of the code. It targets Windows (DesktopGL) and Android but the Android side is completely disabled and the project is unloaded.
Im wondering if it might have something to do with the fact that the content is imported into the Shared Project's content pipeline.
Ill try to add an effect of my own to see if the problem happens on that one as well.
Amazing work by the way! Thank you for sharing it.
Hi Ronen.
I solved it.
For some reason, when reloading the solution from one IDE to the next, the target for the mgcb file changed from "Desktop GL" to "Windows".
I didnt even know this setting existed in the pipeline editor. I thought it simply followed the target platform chosen by the project being built/executed.
Lesson learned. Shared projects do not always automatically update the shared contents pipeline with the right target at compile time.
Thanks again !
Interesting, I didn't know about this option either.
Thanks for sharing! :)