# ManagedCodeVariant

> Defines how C# code in the project is compiled when exporting a build.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public enum ManagedCodeVariant
```

## Remarks

Each variant level is inclusive of the next level. For example, the Debug variant has Unity checks enabled, whereas the Checked variant has Instrumented code paths enabled. You can configure the managed code variant in a Unity project through the Player Settings or via [PlayerSettings.GetManagedCodeVariant](/engine/6000.7/script-reference/unityeditor/playersettings/getmanagedcodevariant.md) and [PlayerSettings.SetManagedCodeVariant](/engine/6000.7/script-reference/unityeditor/playersettings/setmanagedcodevariant.md).

For more information on managed code variants, refer to [Adding diagnostics to C# code](/engine/6000.7/manual/scripting/debugging-and-diagnostics/managed-code-variants.md).

## Fields

| Value                                                                                          | Description                                                                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Checked](/engine/6000.7/script-reference/unityeditor/managedcodevariant/checked.md)           | Compiles C# code with optimizations. Defines UNITY\_ENABLE\_CHECKS, UNITY\_ASSERTIONS and all the same defines as [ManagedCodeVariant.Instrumented](/engine/6000.7/script-reference/unityeditor/managedcodevariant/instrumented.md). Used for running the game with extra checks enabled. |
| [Debug](/engine/6000.7/script-reference/unityeditor/managedcodevariant/debug.md)               | Compiles C# code without optimizations. Defines DEBUG and all the same defines as [ManagedCodeVariant.Checked](/engine/6000.7/script-reference/unityeditor/managedcodevariant/checked.md). Used for debugging the code with a debugger.                                                   |
| [Instrumented](/engine/6000.7/script-reference/unityeditor/managedcodevariant/instrumented.md) | Compiles C# code with optimizations. Defines UNITY\_INCLUDE\_INSTRUMENTATION and ENABLE\_PROFILER. Used for profiling.                                                                                                                                                                    |
| [Release](/engine/6000.7/script-reference/unityeditor/managedcodevariant/release.md)           | Compiles C# code with optimizations. Used for running with all unnecessary code paths disabled and for shipping releases to users.                                                                                                                                                        |
