I’ve changed my Content.RootDirectory to “Data” countless times in XNA without any trouble, with MonoGame tho I’m running into problems.
Adding my built content into my project and having them as “copy if newer” makes all content go to the right folder, however certain files also show up in the built folder under Content/Audio/myfile.xnb, without there being a string anywhere telling it to send the files there.
I’ve changed output directory, intermediate directory, but still MonoGame creates a “Content” folder with bin and obj folders while building, and settles on making a Content folder in my output directory with some of the content files.
I’ve narrowed this down to the build action on the Data.mgcb file itself, if I set it to not build, I get an error and it shows me the command line on building it:
Error 76 The command ""C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"" /platform:Windows /outputDir:"E:\Dev\SVN\jsmars\source\jsmars\Content\bin\Windows" /intermediateDir:"E:\Dev\SVN\jsmars\source\jsmars\Content\obj\Windows" /quiet" exited with code -532462766. C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.Content.Builder.targets 67 5 jsmars
and there you can see /outputDir and /intermediateDir setting a “Content” directory, why doesnt this follow the directories specified in the file?
#----------------------------- Global Properties ----------------------------#
/outputDir:..\Data
/intermediateDir:obj/Windows
/platform:Windows
/config:
/profile:HiDef
/compress:False
#-------------------------------- References --------------------------------#
#---------------------------------- Content ---------------------------------#
#begin Audio/click.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Audio/click.wav
#begin Fonts/font1.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:TextureFormat=Compressed
/build:Fonts/font1.spritefont
When I build the monogame content project from the MonoGame Pipeline tool, everything builds as it should, it is only when it’s build through visual studios build action that this wierd behaviour shows itself. I could always not include the content file, but I’d like to have it in there to be sure content is always built and up to date.