So I wrote this a month ago to reference off of whenever I would want to create new shared projects. Hope it’s useful for you:
HOW TO CREATE SHARED PROJECT
“Monogame Shared Library Project”, “Shared Library Project”, and “Shared Project” may be used interchangeably at times.
-
[If you have already created a new “Shared Library Project”, skip to step 4]
-
Select “File > New > Project” .
-
Select “Monogame Shared Library Project”. Ensure you keep the checkbox “Place solution and project in the same directory” unchecked.
-
Right-click the solution, then select “Add > New Project”.
-
Select whichever platform specific project you wish to start with. I began with the OpenGL version first.
-
When you add a project, it will automatically add a “Game1.cs” to that project. We only need the “Game1.cs” from the “Shared Project”. So for each platform specific project, delete each newly created “Game1.cs”.
-
Everything I said for step 6, do the same thing with the “Content” folders for each of the platform specific projects.
-
For each of these platform specific projects added, we will need to add a reference to the “Shared Project”. Right-click on the platform specific project, then select “Add > Shared Project Reference”.
-
Select the name for the “Shared Project” and click “Ok”.
-
Right-click the “Shared Project”, then select “Open Folder in File Explorer”.
-
After the file explorer opens, open the file with extension “.projitems” in a text editor.
-
After this file opens, scroll down until you find a line(s) that may say both or either of the following:
< MonoGameContentReference Include=“$(MSBuildThisFileDirectory)Content\Content.mgcb” />
< None Include=“$(MSBuildThisFileDirectory)Content\Content.mgcb” />
- As long as the “MonoGameContentReference Include” line is there, you can close out. Otherwise, just add it within the “ItemGroup” section (“< ItemGroup >your stuff< /ItemGroup >” ).