Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Handling compiled content files (*.xnb) for an XNA/MonoGame codebase
  • Create a folder named Content under the Project Folder.

  • Add to the XNA Windows project file:

        <PostBuildEvent>xcopy "$(ProjectDir)$(OutDir)Content\*.*" "$(ProjectDir)Content" /S /I /R /Y</PostBuildEvent>
  • Add to the MonoGame project file:
    <Content Include="Content\\**\*.xnb">
  • Add to .gitignore:
  • Add new file (ProjectFolder)\Content\ReadMe.txt:
    The compiled XNB content files should be automatically copied into this folder when doing an XNA Windows build.
    These files are necessary to build and run the MonoGame version of the application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment