How to use the source code directly in a project?


I’m trying to build my game working directly on the source code, but with no success so far.

Since I’ve already been asked on Discord a while back: it’s because I think it’s handy to have the source available in the project, like the rest of the code is, to view it and to edit it at need. Is this a bad approach? If so, why?

The “best” way I tried so far is this, with MG 3.7.1:

Create a new MonoGame project using a template.
Remove the reference to MonoGame.Framework.
Add all the MonoGame classes for the target platform from the source code.

It builds and runs but it gives an exception when initializing Effects, because it is missing the assemblies from Graphics.Effect.Resources.

I still don’t know if I can work around that, but before diving into it I’m left wondering if that would just be the first of many hurdles, and if there’s any that can’t be worked around, or if there’s just a better\proper way to do this without workarounds.

Any idea? Thank you!

Not sure exactly what the question is or if it has been stated to vaguely for me to answer it.

The source code for monogame however is open source.
So it can be found here and built with vs2019 to generate the entire api.

Thank you for your reply!

If I build from source I get the assembly/dll that is then referenced by the project, but the source is still not accessible from the project/solution.

If I create a MonoGame project and I “go to definition” of something that is part of the framework it shows just the members “from metadata”, can’t really see the code nor edit it right away.

What I’m trying to do is to have all the .cs files for the framework directly in the solution, so they can be accessed and modified right away and compiled together with the rest of my files when building the solution.


You need to add MonoGame as a projectreference, it sounds like added a assemblyreferece