> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/flatredball/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/flatredball/flatredball-source/linking-fna.md).

# Linking FNA

### Introduction

By default FlatRedBall projects link pre-built binary files including prebuilt FNA libraries. You may want to link your FlatRedBall project to FNA source for improved debuggability or to contribute back to FNA.

This document includes the required steps for linking your game to FNA.

### Linking Your Game to FRB Source

Before you link your game to FNA, you must first link your game to FRB source. If you do not do this, then the FlatRedBall.FNA nuget package will include FNA which results in the FNA libraries being included twice.

Follow the steps outlined here to link your game to source: [Linking your Game to FlatRedBall Source](/flatredball/flatredball-source.md#adding-flatredball-source-to-a-game-project-using-the-frb-editor).

Once you have finished these steps, your solution should include your game project and all FlatRedBall source projects.

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2F3BFKGrW8K7WzTH8l3KrE%2Fimage.png?alt=media&amp;token=b1f87621-d66d-469c-8b84-63971c398f81" alt=""><figcaption><p>A game named FnaTest4 linking all FlatRedBall FNA source projects</p></figcaption></figure>

{% hint style="info" %}
FNA is a submodule of the FlatRedBall repository so be sure you clone FlatRedBall recursively to get FNA.
{% endhint %}

### Linking Latest Native Libraries

By default FlatRedBall templates include FNA binaries which are marked as copy if newer. These can be found in your game's csproj at the root level:

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2FEaWbUioYq8YntVNaPr6X%2Fimage.png?alt=media&amp;token=6515b438-c820-40bc-91e6-3b6131bce94b" alt=""><figcaption><p>FNA native libraries in a game</p></figcaption></figure>

These are marked as copy if newer:

<figure><img src="https://951240982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fye9Ufg3vzJxwX5Hk%2Fuploads%2FbLGnCz5Ffx2gK8L6ZpED%2Fimage.png?alt=media&amp;token=7c1cde62-00d8-48ef-8e31-c6f648783626" alt=""><figcaption><p>One of the FNA files marked as Copy if newer</p></figcaption></figure>

If you would like to update these to the latest version, you can:

1. Download the latest daily files from <https://github.com/FNA-XNA/fnalibs-dailies/actions>
2. Unzip the folder for x64
3. Copy the files into your game project

The latest .dll files will now be copied to your bin folder whenever the game is built.


---

# 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/flatredball/flatredball-source/linking-fna.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.
