# Running from Source

## Introduction

Gum is an open source project so you can run it from source instead of running the pre-compiled project. Running from source is not a requirement, and is only needed if you intend to contribute to Gum or if you'd like to diagnose problems in a debugger.

## Obtaining the source code

1. Download the source file from [GitHub](https://github.com/vchelaru/gum)
   1. If you downloaded the .zip file from the GitHub main page, unzip the file
   2. If you downloaded the file through a Git client, be sure to be on the `main` branch

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-0b307baf98aaf7f4c2862c21f6f9f1ce7a401d2b%2Fimage%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption><p>Gum repository in Github Desktop</p></figcaption></figure>

## Running the code

1. Locate the Gum.sln file
   1. If you downloaded the .zip, it is in the root folder of the zip
   2. If you cloned the repository, it is at the root of the Gum folder
2. Double-click it to open Visual Studio, or open Visual Studio and load the .sln
3. Be sure to build solution rather than pressing F5 (which only builds the current project). This guarantees that all plugins are built and copied correctly. For more information see below.

Once the project has been built, you can run (with or without a debugger attached).

### Building Plugins

Gum depends on a number of plugins for its functionality. By default if you build the project and run it (such as by pressing F5 in Visual Studio), then plugins are not automatically built. To build plugins, you need to explicitly build all plugin projects. The easiest way to do this is to select the Build -> Rebuild Solution option in Visual Studio.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-d9ff318594dbe6de46b1827efd7b897bf080d057%2Fimage%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption><p>Build -> Rebuild Solution in Visual Studio</p></figcaption></figure>

## Troubleshooting

### Missing Editor Tab

If your Editor Tab is missing, be sure to Build -> Build Solution. The Editor tab is a plugin, and you can verify that the plugin is in fact being built/loaded.

First view plugins:

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2FNMpqsv9kvlDToUiV3L3I%2F14_15%2059%2013.png?alt=media&#x26;token=31f98edb-636e-4317-9ae2-94c6cb6631d8" alt=""><figcaption></figcaption></figure>

Next, look for the Editor tab plugin in the list that appears:

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2F8hkthOKwELJzX8etBAri%2F14_16%2001%2014.png?alt=media&#x26;token=7fd493c2-6853-477c-9795-854afcc596e7" alt=""><figcaption></figcaption></figure>

If you are missing this, be sure to Build -> Build Solution.

### A project with an Output Type of Class Library cannot be started directly

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2F1zsFKFM2uovtsl2qIP1h%2F20_09%2020%2007.png?alt=media&#x26;token=cd96b60b-71c0-427e-a54d-68fdff84515c" alt=""><figcaption></figcaption></figure>

If you have this popup, you need to set Gum as the startup project.

In Visual Studio:

1. Right-click on the **Gum** project (not the solution)
2. Select **Set as Startup Project**

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2FzOZ7vaCpHej15k4MV5Ni%2Fimage.png?alt=media&#x26;token=88d229af-609d-4aac-a6b7-f48acd49d05f" alt=""><figcaption></figcaption></figure>
