Duplicate XNBs after Visual Studio Build

The problem I am having is when I “Build” my game from within Visual Studio any assets previously built within the Content Pipeline Tool get duplicated. The duplicated files then get copied to my projects \Bin\Platform…\Content\ directory.

I’m not sure if this is expected behavior or not, but when I go to update any of those assets only the original XNB files get overwritten, the duplicates do not. Thus no changes ever get copied to the \Bin\Platform…\Content\ directory.

To clarify, when I press “Build” in the Content Pipeline tool I get two files:

  • ProjectDir\Content\Bin\Platform\asset.xnb
  • ProjectDir\Content\Obj\Platform\asset.mgcontent

Afterwards, when I press “Build” in Visual Studio, I get the following new folders and files:

  • ProjectDir\Content\Bin\Platform\Content\asset.xnb
  • ProjectDir\Content\Obj\Platform\Content\asset.mgcontent

Note the extra “content” folders in both \Bin\ and \Obj\ which contains duplicate files. These are the files that get copied to the final Bin folder, but never get updated.

Has someone run into this before? Or is there something I’m missing? Should I just create a standalone pipeline project and copy the XNBs manually?

So I’ve done some testing on this and it appears that even in a clean project/solution, both Visual Studio and the Pipeline Tool output XNBs to different directories:

Visual Studio Build: ProjectDir\Content\Platform\Content\asset.xnb
Pipeline Tool Build: ProjectDir\Content\Platform\asset.xnb

Note that if I ONLY build through Visual Studio, I still get the extra “Content” directories, but my assets do get updated correctly. If I was to then build within the pipeline tool, my assets would get duplicated and become out-of-sync.

I don’t understand where the extra “Content” directory is coming from as my “Build Action” is set to MonoGameContentReference and includes the file Content\Content.mgcb (below). I’ve even double checked my .csproj but everything looks ok.


If it helps i’m using Visual Studio 2017 and the Pipeline Tool is version – I’m sure these are out of date, and maybe an update would fix it? Short of that I guess I could edit the paths in the Content.mgcb file (though I shouldn’t have to?) or simply never use the build/rebuild buttons in the pipeline tool and instead let Visual Studio handle it instead.