Setup source code and start example to debug Monogame execution

How do I setup Visual Studio 2013 to use Monogame source code and that blue screen sample to be able to debug and step in the actual framework source?

The easiest way is to have MonoGame installed so the VS project templates work. You will also need a clone of the GitHub repo. Run Protobuild.exe in the root of the repo to generate the MonoGame project files. In VS, create a new MonoGame project. Now remove the reference to the MonoGame assembly. Right-click on the solution node in the Solution Explorer and add an existing project. Find the MonoGame project file in the MonoGame.Framework folder in the repo. Now add a reference from your game project to the MonoGame project. You should now be able to build and run, and step through the MonoGame source.

1 Like

Now add a reference from your game project to the MonoGame project.

Could you elaborate on what kind of reference is needed to add to the MonoGame project?
I have a game project setup ready to reference, but VS only accepts .dll, .tlb, .olb, .ocx, .exe, and .manifest files. I can’t add a reference to the .csproj file. I haven’t done this sort of referencing before, so I may be making a very simple mistake or not properly understanding what should be done.

Do I need to build the game project prior to adding the monogame project reference?
If you could explain this in more detail, it would be greatly appreciated! Thanks.

If you added the MG project to the solution, click Add References… and it will be listed under Projects>Solution. That way you reference the project directly and it will automatically rebuild when you made changes and try to run your game

Thanks, that fixed my problem. I thought I was supposed to add a reference to the game project in the monogame project, which really didn’t make any sense.

I set up a PR to explain this in the documentation

Thanks a lot for your detailed guide!