Windows 8 Game Development using C#, XNA and MonoGame 3.0: Building a Shooter Game Walkthrough – Part 3: Updating Graphics using Content Pipeline with MonoGame



MonoGame currently does not have a Content Pipeline as a part of the framework therefore we will need another way to create the XNB files from our graphic and sounds assets. That is where the Windows Phone SDK comes in with Visual Studio 2012 (WP 8.0 SDK) and/or Visual Studio 2010 (WP 7.1 SDK) comes in. You can use the XNA Windows Phone Game project under Visual Studio 2012 or Visual Studio 2010 to compile your graphics assets and then add them to your Visual Studio 2012 MonoGame project. Please note: The graphics shown in this blog post may either depict usage of VS 2012 OR VS 2010 for the Content Pipeline but the steps for completion are the same no matter which product (VS 2012 or VS 2010) is used.


Creating a Content Pipeline for MonoGame

To create a Content Pipeline for MonoGame we must leverage the XNA Game Studio inside of Visual Studio 2012 or Visual Studio 2010 which is installed with Windows Phone 8 SDK (VS 2012) or Windows Phone 7.1 (VS 2010). So the first step in creating a Content Pipeline for your game is to start Visual Studio (2010/2012), and select XNA Game Studio from the Templates.


Step 1 – Opening and Registering Visual Studio 2012/2010 Express (First Time Users)

However, if this is your first time using Visual Studio 2012 or 2010 Express for Windows Phone, you will get a dialog box prompting for you to get a Registration Key. Click the Obtain a registration key online button.









Figure 1 Visual Studio 2010 Express registration


This will open up a Sign in screen, Log in with your email address and password associated with your Windows Live ID (Microsoft Account) or associate your email address with Window Live by registering your email address as a Windows Live ID and login. Fill out information require (if any) and then click the Submit button. If you are successful, a Thank You for registering message should come up displaying your registration key. See Fig. 2 below.












Figure 2 Visual Studio Registration Confirmation Dialog Box


Copy the registration key displayed, and paste it into the registration dialog shown previously in Figure 1. The Register Now button should now become available, therefore, Click the Register Now button.


Step 2 – Creating the XNA Game Project

Once Visual Studio starts, select New Project. Select Windows Phone Game, Windows Game or XBOX Game as appropriate to the version of Visual Studio you are using. Name the project ShooterContent and click OK. See Fig 1a and Fig 1b.



Figure 1a Visual Studio 2012 XNA Game 4.0 Project








Figure 1b Visual Studio 2010 XNA Game 4.0 Project


Now obtain the graphics for the Shooter game. I have provided these graphics for you. Click on the link: and Click on the Shooter Graphics and Sound files folder. Download all of the files contained within that folder and subfolders to an accessible location on your computer.


Step 3 – Creating a Content Manager for the Graphic, Font, and Sound Files using XNA Content Pipeline

Now that your XNA Windows Game project (ShooterContent) has been created, we can create a content manager. In the Solution Explorer, right click on the ShooterContentContent (Content) project and add two (2) new folders. Name the folders Graphics and Sound respectively. Add all the graphic files (.png files) and font files (.spritefont) from the location in which you downloaded the files provided above into the Graphics folder. Add the sound files (.wav) from the location in which you downloaded the files provided above the Sound folder. See Figure 1 below.

Figure 1 Visual Studio 2010 Express - Adding Content files to the Content Pipeline


Once all the files are added into your XNA Game solution and your XNA Game Studio project Solution Explorer resembles the graphic shown in Figure 1 above. Compile/Build the Entire ShooterContent Solution. Once you have successfully compiled without error, you can close the ShooterContent XNA Game Studio project.


Step 4 – Creating a Content Manager for the Graphic, Font, and Sound Files using XNA Content Pipeline

Now Reopen your MonoGame Project . If you have followed along with Part 1 and Part 2 of this MonoGame blog series, in the Solution Explorer you will see a Graphics folder with an .xnb file once the project has opened. For clarity and to ensure there no conflicts with our next steps. Delete the Graphics folder and all its contents from your project. Clean and rebuild the solution.

Inside the Solution Explorer, go to Win8ShooterGame project root and add a folder named Content by right-clicking and choosing Add, New Folder. Underneath this new folder, add two new folders named Graphics and Sound by right-click on Content Folder and choosing Add, New Folder. See graphic in Figure 1 shown below.

Figure 1 Adding Content Folders to the Project

Now Right click on Graphics Folder and select Add, Existing Item. Navigate to C:\Users\[you]\Documents\Visual Studio 2012\Projects\ShooterContent\ShooterContent\ShooterContent\bin\x86\Debug\Content\Graphics or C:\Users\\Documents\Visual Studio 2010\Projects\[you]\ShooterContent\ShooterContent\ShooterContent\bin\x86\Debug\Content\Graphics

Select all the files located in this folder and Click Add.

Select the Sound Folder and select Add, Existing Item. Navigate to C:\Users\[you]\Documents\Visual Studio 2012\Projects\ShooterContent\ShooterContent\ShooterContent\bin\x86\Debug\Content\Sound or C:\Users\\Documents\Visual Studio 2010\Projects\[you]\ShooterContent\ShooterContent\ShooterContent\bin\x86\Debug\Content\Sound

Select all the files located in this folder and Click Add.


Figure 2 Adding Graphics files to MonoGame project folders

Once files have been added within your MonoGame project, select add the files in the Graphics folder. With the files selected, right-click and select Properties.

 Figure 3 Select the Properties option for files

Under properties, set Build Action to property to Content and Copy to Output Directory property to Copy Always. Repeat these same steps with the files in the Sound folder.


Figure 4 Change Properties options of the files 

You've written enough code for now - let's see it in action! Build and run your game by either via Local Device or and the Windows Simulator. If successful, you will see the Cornflower Blue background with the Ship (player) shown on the screen.

Figure 5 Ship/Player Drawn on the Screen

In this walkthrough, we went through the step to create and leverage the Content Pipeline for graphics and sound. Now have created your Content pipeline and added the needed graphic and sound files, these files can be leveraged for the Shooter game. The Shooter player graphic is loaded and displayed on the screen from the Content Pipeline generated graphic files. In Part 4 of this series, we will add input logic and code to respond to various types of user input and control the player (ship) within the game. The input logic should respond to the user input in using mouse, keyboard and gestures.


Comments (35)
  1. Jim says:

    Thanks for the tutorials. These are helping a bunch.

  2. Miky says:

    Thanks for the tutorials!

    But I don't have a "Windows Game(4.0)" or "Windows Phone Game(4.0)" Template.

    in "XNA Game Studio 4.0" I only have "Content Pipeline Extension Library(4.0)" and "Empty Content Project(4.0)".

    I re-installed Windows Phone 8 SDK and still no help.

    I use Visual Studio 2012 Ultimate Update 1

  3. T E W says:

    Hi Miky: I am using a Windows 8 machine with VS 2012 Ultimate installed as well with an installation of Windows Phone 8 SDK.  Only difference is that I had installed VS 2010 as well for this tutorial in order to provide options to readers.  Let me try and install VS Ultimate on my slate with Windows 8 SDK without VS 2010 and see if I can repro what you see on your machine.

  4. Miky says:

    Thanks T E W for your help.

    I just installed Microsoft Visual Studio 2010 Express for Windows Phone and Microsoft Visual Studio 2010 Express for C#.

    And I still don't have the templates on Visual Studio 2012 ultimate.

    what could I do next ?

  5. TZ says:

    T E W – Thank you for the tutorials!   I can use most of this information.  

  6. T E W says:

    Okay Miky:

    I am installing on a Windows 8 box with clean install the VS 2012 Ultimate and Visual Studio and Windows Phone SDK's to try and repro you issue.  Let me see what I get now, so I we can resolve this for you.

  7. Harald H Gundersen says:


    Is it possible to Load a 3D Autodesk fbx file (after being content processed by the Autodesk FBX – XNA Framework in Your content Project

    With the MonoGame thingie..??

    Regards and thx for an interesting article,


  8. Got these warning messages:

    1>—— Build started: Project: Win8ShooterGame, Configuration: Debug Any CPU ——

    1>C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "SharpDX.Input". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

    1>C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "SharpDX.DXGL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

    1>C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "SharpDX.Toolkit.Graphics". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

    1> Win8ShooterGame -> C:DevelopmentMonoGameWin8ShooterGameWin8ShooterGamebinDebugWin8ShooterGame.exe

    2>—— Deploy started: Project: Win8ShooterGame, Configuration: Debug Any CPU ——

    2>Updating the layout…

    2>Copying files: Total <1 mb to layout…

    2>Deployment complete. Full package name: "4b042624-7d51-4377-a49e-8abc3858cafa_1.0.0.0_neutral__hz17derscp9c6"

    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

  9. The MonoGame installer places all the required assemblies into the C:Program Files (x86)MonoGamev3.0Assemblies folders.

    Specifically it should be in the subfolder C:Program Files (x86)MonoGamev3.0AssembliesWindows8.

    The folder

    C:Program Files (x86)MonoGamev3.0AssembliesWindows8

    contains the following assemblies:


    SharpDX.D3DCompiler.dll   <<<— not referenced in VS?




    SharpDX.DXGI.dll   <<<— not referenced in VS?



    SharpDX.XInput.dll   <<<— not referenced in VS?

    I use the template MonoGame Game (XAML) Visual C# within the VS 2012 Express for Windows 8.

    references that were automatically added when the project was created:

    .NET for Windows Store apps





    SharpDX.DXGL    <<<— wrong reference in VS?

    SharpDX.Input   <<<— wrong reference in VS?


    SharpDX.Toolkit.Graphics   <<<— wrong reference in VS?



    I have this IDE version:

    Microsoft Visual Studio Express 2012 for Windows 8

    Version 11.0.51106.01 Update 1

    Microsoft .NET Framework

    Version 4.5.50709

    Installed Version: VSWin Express

    Team Explorer for Visual Studio 2012   04933-004-0021004-02933

    Microsoft Team Explorer for Visual Studio 2012

    temporarily resolved the warning messages manually:

    removed the 3 bogus SharpDX.* assembly references and added the ones that had not been referenced.

    that should do it for now, at least until a fix is available.

  10. T E W says:

    Hi ON-2012:

    Did you use the updated MonoGame Windows installer? http:/ I had this initial problem when I was getting the MonoGame resources from GitHub and cloning the 3.0 branch. I had to manually fix the references in Visual Studio.  But when I removed them and the templates, and reinstalled everything worked great with no warnings.  Let me know how this works.

  11. I used the links you provide in the first tutorial of this walkthrough series.

    Do you use VS 2012 Express?   The guys at CodePlex mentioned the possibility that this could be a problem of their installer in VS Express.  I would assume you use a Pro version of VS 2012, right?

    I uninstalled VS 2012 Express and installed it again to no avail.  

  12. I used the installer from this link:…/511666

    which was provided in Tutorial #1.

  13. I used


    is this correct?

  14. T E W says:

    Hi ON-2012: The link you noted was the first one I used, since Jan. 21st they have released a new download link:…/100041.

    Did you uninstall and remove all the references to MonoGame and then reinstall. This is the stable release of the MonoGame 3.0 above.

  15. Thank you Tara!

    As per your suggestion, uninstalling MonoGame and the new link to download the latest MonoGame resolved the reference problem.

    It's 2:30am here in Europe now.  Good night.

  16. The problem with the bogus SharpDX.* assemblies in the References of the VS project got resolved after uninstalling MonoGame and installing the latest release from Jan 21, as per your suggestion.

    However, now the Win8ShooterGame example does not work.  It was working before all this uninstall/reinstall of MonoGame.  Any suggestion?

    Thank you.

  17. Hi Tara,

    You may disregard my previous comment.  After removing the old MonoGame-related References in the Win8ShooterGame project and adding the new references from the newer MonoGame 3.0 installation, the program seems to work fine.

    Thank you for the help.

  18. Thanks T E W for this tutorial walkthrough series.   Good work.

    I look forward to seeing more of this kind of step-by-step documentation on Windows 8 MonoGame development available in the near future.

  19. Amer says:

    Any luck with part 4?  Great tutorial. Thank you

  20. Good tutorial. The one problem I see with sticking with XNA (after porting a bunch of code) is that I have not figured out a way to port the advertising portions since the sdks are all XAML based. So it looks like XNA win 8 games won't be able to add ads (at least at the moment).  If anyone figures out a solution so you can put PubCenter or AdDuplex ads in let me know…

  21. Komodo1138 says:

    Great tutorial so far.

    I was wondering if there was an estimated ETA on part 4.

    Thank you for all the hard work you have put into this tutorial so far.

    Chris H.

    aka Komodo1138

  22. T E W says:

    @RodneyAK : You can't add the AD SDK on the XAML GamePage that is hosting the Game class.  I haven't tried it but I can when I get finished with building this game I can try to play with it to get the ADs working.  I could have sworn someone did make this happen.

  23. T E W says:

    @Amer: Yes finally got it working and it is published.

    @JakeFi: Whistling!

    Komodo1138: ETA was 8 hours ago, finally got things working.

  24. DHR says:

    This the error i'm getting again and again.Can u please tell me what is the problem.

    Error:Cannot autodetect which importer to use for "Graphicsplayer.xnb". There are no importers which handle this file type. Specify the importer that handles this file type in your project.

  25. T E W says:

    @DHR: Did you set the player.xnb file properties as noted?  The properties for the file should be set to type = Content, and Copy to Output = Copy Always.

  26. Záby says:

    Here is another option for create XNA content:

  27. Is there any way to get windows phone sdk running a 32 bit windows 8?

    maybe with the new monoGame Installer 3.0.1?

    provides a few new options like windows 8 phone project.

  28. ios29A says:

    You should click "Add as Link" in the add button dropdown (step 4, fig 2), so in case of changing any assets and thier recompilation there was no need to copy them again into the destination

  29. Harris says:

    I'm having the same problem, it only shows the content pipeline stuff and not the game templates. I have VS2012 on a Windows 8.1 Machine

  30. Sorrien says:

    Using Visual Studio 2013 Express with monogame version 3.2. Everything pretty much works fine until I go to add the .xnb files from the debug folder. There is only an empty content folder there, and I have triple checked that I followed all of your instructions. Not sure what's wrong here.

  31. Marcos says:

    Hey, thanks a lot for this! Even though I have run into some problems, the workarounds on google are easy to find, and this has helped me immensely with getting started on XNA/Monogame. Thanks a bunch!

  32. Jim G says:

    For anyone trying this having issues with getting the correct xna game template to appear on the list, you can give this a try. I spent a couple of hours pulling out my hair and trying to get the Windows Phone SDK 8.0 to work with no joy. Finally, I ran across a reference to Microsoft XNA Game Studio 4.0 which you can download separately.…/details.aspx

    That plus Visual Studio 2010 Express for Windows Phone did the trick.

    Fyi, I'm creating the game itself on Visual Studio 2013 Express for Windows Desktop on Windows 8.1.

  33. David says:

    I'm confused why are we building a traditional XNA project? How does this allow me to make my game cross platform? I am looking to my game for Linux.

  34. Klaas Wassenaar says:

    With current version of monogame, you can files like .png .mp3 straight to the solution without any extra action.

    Or will this create trouble down the line?

Comments are closed.

Skip to main content