Monogame Shared Library Project doesn't work

So… I’m trying to make use of MonoGame’s cross platform capabilities in VS2019, and I’ve seen a few tutorials about using a Shared Project to share code, and the issues regarding Content management for this… That’s when I saw the “MonoGame Shared Library Project” template.

It’s description says it can be used to share code and content between projects, but how do I do that? I mean, even though the project comes with it’s own Game1.cs and Content folder, you can’t access them from within Visual Studio. You also can’t add classes and folders to the project, nor can you add a reference to it from other projects (It doesn’t even appear). I’ve also tried checking the properties and the .shproj file, but nothing seemed to make it work…

So my question is: how do I use it? Is there an issue regarding this template in VS2019, or am I doing it the wrong way? Should I stick to the normal C# shared project for this?

P.S.: I haven’t checked if it works with VS2017, but I also don’t have enough disk space on C: to install it, so I’d rather avoid this.

What version of MonoGame does the bug occur on:

  • MonoGame 3.7

What operating system are you using:

  • Windows

What MonoGame platform are you using:

  • DesktopGL, WindowsDX, Android
1 Like

I believe the shared project stuff is old. I think the templates and docs are getting updated for the next release, but try using a netstandard2.0 library like this.

Shared projects should be working in vs 2019, if it’s not showing up in visual studio, could you please verify that it has been added to your solution (.sln file)? You may need to open the sln in notepad or something similar to check.

If it is not referenced by the Solution file, you will need to add this by opening the solution in Visual Studio, right-clicking on where the solution shows up in Solution Explorer, add existing project and then add the shared project.

Another thing, just in case you are new to Visual Studio, ensure that the solution explorer is in solution view and not folder view.

Hopefully this helps.

This should help you, let me know if you are still having issues with MG and VS19.

And @bootzin, Welcome to the Forums!

Happy Coding!