# Gum Source Linked Project

> Gum Source-Linked Project

- Skill: `vchelaru/gum-source-linked-project` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vchelaru/gum-source-linked-project`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vchelaru/gum-source-linked-project/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vchelaru (https://skillmd.com/u/vchelaru)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vchelaru/gum-source-linked-project

---


# 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 `.gumx` from `Content/`): `Samples/GumFormsSample/MonoGameGumFormsSample/MonoGameGumFormsSample.csproj`

## Fastest path: `dotnet new mgdesktopgl`, then rewire

1. `dotnet new install MonoGame.Templates.CSharp` — not bundled with the SDK.
2. `dotnet new mgdesktopgl -o <dir> -n <ProjectName>`.
3. In the generated `.csproj`: set `<TargetFramework>net8.0</TargetFramework>` (the template defaults to the newest installed SDK, which can be ahead of Gum's `net8.0`) and pin `MonoGame.Framework.DesktopGL`/`MonoGame.Content.Builder.Task` to `3.8.4.1` — the exact version every Gum sample uses — instead of the template's floating `3.8.*`.
4. Add `<ProjectReference Include="..\..\Gum\MonoGameGum\MonoGameGum.csproj" />` (path relative to wherever the new project sits).
5. In `Game1.cs`: `GumService.Default.Initialize(this)` in `Initialize()` for code-only defaults, `GumUI.Update(gameTime)` in `Update`, `GumUI.Draw()` in `Draw`. For a `.gumx`-loading project instead, pass the project's relative path as `Initialize`'s second argument and mirror the `Content\<ProjectFolder>\**\*.*` `CopyToOutputDirectory` item group from `MonoGameGumFormsSample.csproj`.
6. To open it in Visual Studio, create a solution: `dotnet new sln -n <ProjectName>` then `dotnet sln add <ProjectName>.csproj` — add the **game project first**. `dotnet sln add` pulls in its `ProjectReference`s (`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.

