> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
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=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
