[SOLVED] Adding MGCB project to existing MonoGame project

Hello,

is there any place explaining how to add a MGCB project to an existing MonoGame VS project?

Also, is it possible to have multiple MGCB projects in a single MonoGame VS project?

Hi,

For the 1st question: Look here: http://rbwhitaker.wikidot.com/monogame-managing-content.
You can create a new content file with the tool, then in VS, “add existing item” and voilà.

Conerning the second one: yes you can :slight_smile:

The xnb’s may end up in the wrong folder if you set the build action of the other mgcb’s to MonoGameContentReference though :confused: The related issue is https://github.com/MonoGame/MonoGame/issues/4977

Well I didn’t encounter this issue with my 2 mgcb as I never do a clean on any of them. Moreover they are not built when the project is built under VisualStudio. I only use the pipeline tool. Maybe I should check thisfor duplicates between the two, which could mask the problem.

thanks both! The answers were so obvious that I’m feeling a bit stupid :joy:

I haven’t been able to try this until today. Unfortunately rbwhitaker’s 503, so I can’t check if the extra steps I had to do, but those are here just in case somebody needs them also (like myself and my fish-like memory :slight_smile: )

The project was very very old (I created it back in Jan’2014), it probably started as a Xamarin Studio project, so newer projects might not need this.

In order to get the project compiling and working I also had to add this to the .csproj file:

<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />

And edit mgcb file to build as MonoGameContentReference.

Then MGCB was complaining about the platform, so added in the first PropertyGroup:

<MonoGamePlatform>Android</MonoGamePlatform>