---
title: "Source Context"
description: "Learn about setting up source bundles to show source code in stack traces on the Issue Details page."
url: https://docs.sentry.io/platforms/unity/data-management/debug-files/source-context/
last_updated: 2026-12-04T06:01:50.000Z
---

# Source Context for Unity

If Sentry has access to your application's source code, it can show snippets of code (*source context*) around the location of stack frames, which helps to quickly pinpoint problematic code.

For example, here's a stack trace with source context. The source context contains the original C# source code of the application, with the location of the frame highlighted.

### [Source Bundles](https://docs.sentry.io/platforms/unity/data-management/debug-files/source-context.md#source-bundles)

Certain SDKs, such as the Python SDK, can resolve this source context automatically, because they have access to unobfuscated source code at runtime. By contrast, to get source context for compiled applications, the source code needs to be uploaded alongside the debug information files. The recommended way to do this is by using the Sentry CLI. See [Creating Source Bundles](https://cli.sentry.dev/commands/debug-files/#sentry-debug-files-bundle-sources-path) for more information.

The Unity SDK can upload source bundles for you. Enable **Upload Sources** on the **Debug Symbols** tab in **Tools > Sentry**, or set [`UploadSources`](https://docs.sentry.io/platforms/unity/configuration/options/cli-options.md#UploadSources) in code. The SDK then passes `--include-sources` to Sentry CLI during the automated debug symbol upload.

After they've been uploaded you can review and manage source bundles the same as any other debug information file. See [Managing Debug Information Files](https://docs.sentry.io/platforms/unity/data-management/debug-files.md#managing-debug-information-files). Source bundles will be tagged with `sources`, and will carry the same filename as the respective debug information file they were created from.

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
