This MGFX effect was built for a different platform!

Hey everyone,

I’m having a problem with a multi-platform MG project. The project is mostly common code, which is stored in a shared project referenced by both a Windows MG project and an Android MG project.

There’s also only one content (.mgcb) file which is linked to independently from the Windows and Android projects. The shared project doesn’t know the mgcb file exists, and does nothing with it. It’s built independently by the platform projects.

When I compile and run, the Windows project works fine, but when I call Content.Load for my Effects in the Android one, I get an exception saying This MGFX effect was built for a different platform!

I’m using MG v3.7.1, and there’s no option in the pipeline tool to build effects for different platforms. My effect files are in HLSL, and based on the templates that you’re given when you add a new effect into the content pipeline tool.

Can anyone make an educated guess what’s happening?
Thanks for the help!

The issue may be that the .mgcb file is set to build all content for Windows. If you set it to Android and fire up the Android project, does it work?

Others have discussed ways to get the pipeline tool to build the same set of content on a per-platform basis, but I’m not sure if the results have been successful or not. What I do is primarily work and test on a single platform. If I need builds, I manually set it to build content for each platform. This works well for me since I don’t make builds often, but others might be able to pitch in on what works for them.

Thanks for the reply - yes, you were right! I’ve rearranged it a bit so that each project now has its own mgcb file, and they both link to the same content. Now it works fine :+1: