Gum Source-Linked Project
For manually running a MonoGameGum/GumCommon change in a real game (see the tdd skill for when a unit test isn't enough). Two of Gum's own samples are already working reference projects for this exact pattern — start from one of them rather than guessing:
- Code-only (no
.gumx, UI built via C#):Samples/MonoGameGumInCode/MonoGameGumInCode/MonoGameGumInCode.csproj - File-based (loads a real
.gumxfromContent/):Samples/GumFormsSample/MonoGameGumFormsSample/MonoGameGumFormsSample.csproj
Fastest path: dotnet new mgdesktopgl, then rewire
dotnet new install MonoGame.Templates.CSharp— not bundled with the SDK.dotnet new mgdesktopgl -o <dir> -n <ProjectName>.- In the generated
.csproj: set<TargetFramework>net8.0</TargetFramework>(the template defaults to the newest installed SDK, which can be ahead of Gum'snet8.0) and pinMonoGame.Framework.DesktopGL/MonoGame.Content.Builder.Taskto3.8.4.1— the exact version every Gum sample uses — instead of the template's floating3.8.*. - Add
<ProjectReference Include="..\..\Gum\MonoGameGum\MonoGameGum.csproj" />(path relative to wherever the new project sits). - In
Game1.cs:GumService.Default.Initialize(this)inInitialize()for code-only defaults,GumUI.Update(gameTime)inUpdate,GumUI.Draw()inDraw. For a.gumx-loading project instead, pass the project's relative path asInitialize's second argument and mirror theContent\<ProjectFolder>\**\*.*CopyToOutputDirectoryitem group fromMonoGameGumFormsSample.csproj. - To open it in Visual Studio, create a solution:
dotnet new sln -n <ProjectName>thendotnet sln add <ProjectName>.csproj— add the game project first.dotnet sln addpulls in itsProjectReferences (MonoGameGum.csproj,GumCommon.csproj, ...) automatically, but whichever project lands first in the solution becomes the VS startup project — if a referenced library ends up first, F5 does nothing useful (it tries to launch a library, not the game). Newer .NET SDKs generate a.slnx(XML) file instead of.sln— same rule applies.
Verified: this recipe builds clean (0 new errors) against Gum's current source tree.