When targeting multiple platforms with Xamarin, a common approach is to use a Visual Studio shared project for the code or assets that are common. In the case of a MonoGame project, this means moving the .mgcb file to a shared project. However, a shared project doesn't support a Build Action of "MonoGameContentReference". A simple fix to this is to open the .projitems file from the shared project in a text editor, and change the ItemGroup entry for the .mgcb file from "None" to "MonoGameContentReference". A disadvantage to this approach is that the Visual Studio IDE will no longer show the .mgcb file, but the build should work.

Comments

bonjouridee - July 26, 2018 at 6:23 AM
Thanks a lot for this tip ! You still can see the Content.mgcb file by toggling the “Show all files” option in the Solution Explorer 😉