> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/code/getting-started/setup/adding-initializing-gum/monogame-kni-fna/visual-studio-code-and-linking-source.md).

# Visual Studio Code and Linking Source

## Introduction

This page explains how to modify your project so that the Gum source appears in Visual Studio Code.

{% hint style="info" %}
Linking to source is optional - the quickest way to get set up is to use NuGet, but linking to source can be useful for improved debuggability, access to fixes and features before NuGet packages are published, or if you are interested in contributing.
{% endhint %}

## VS Code Visibility (Multi-root Workspace)

If you are using Visual Studio Code, you may notice that even after linking the projects, the `MonoGameGum` source code does not appear in your File Explorer. This is because VS Code defaults to showing only the folder you have opened.

To make the source project visible and editable alongside your game, you can convert your setup into a Multi-root Workspace:

1. Open your game folder in VS Code.
2. Go to File > Add Folder to Workspace...
3. Navigate to and select the `MonoGameGum` folder.
4. Go to File > Save Workspace As... and save the file (e.g., `MyGame.code-workspace`) in your project root.

Both folders will now appear in your sidebar as separate "roots," allowing you to browse, edit, and step into the Gum source code while debugging.

## **Alternative: Using a Solution File**

If you have the C# Dev Kit extension installed, VS Code can also behave more like "normal" Visual Studio using a `.sln` file:

1. Open a terminal in your game's root.
2. Create a solution if you don't have one: `dotnet new sln`
3. Add your game and the Gum source to it:

   Bash

   ```
   dotnet sln add YourGame.csproj
   dotnet sln add ../Path/To/MonoGameGum/MonoGameGum.csproj
   ```
4. The projects will now appear in the Solution Explorer pane (the icon with the three stacked boxes), even if the folders are in different locations on your hard drive.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/code/getting-started/setup/adding-initializing-gum/monogame-kni-fna/visual-studio-code-and-linking-source.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
