# Code stripping

Unity supports [code stripping](https://docs.unity3d.com/Manual/ManagedCodeStripping.html) as part of the engine. Code stripping automatically removes unused or unreachable code during the Unity build process, to decrease the application’s final size.

{% hint style="danger" %}
Setting code stripping above Minimal level is risky and might break your game by removing code that's needed for it to run.
{% endhint %}

Starting from 1.4.0, we're generating a `link.xml` file in `Assets/coherence/link.xml` with the needed directives to support the coherence SDK. This file is generated at build time, and deleted after the build.

If you're on previous versions of the SDK, and you're considering using code stripping above Low level, add the following link.xml file anywhere in your project (e.g., `Assets/link.xml`):

```xml
<linker>
  <assembly fullname="System">
    <type fullname="System.Net.Configuration.ConnectionManagementSection" />
    <type fullname="System.Net.Configuration.ConnectionManagementElementCollection" />
    <type fullname="System.Net.Configuration.NetSectionGroup" />
  </assembly>

  <assembly fullname="System.Configuration">
    <type fullname="System.Configuration.ExeConfigurationHost" />
  </assembly>
</linker>
```

Read more on how link.xml works in Unity on their [code stripping](https://docs.unity3d.com/Manual/ManagedCodeStripping.html) section.

In any case, there's no one-size-fits-all solution to be safe when it comes to code stripping. It highly depends on your project, and also your dependencies (third party libraries and assets used).

If you are experiencing issues with coherence while using code stripping,[ reach out to us](https://community.coherence.io/).


---

# Agent Instructions: 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:

```
GET https://docs.coherence.io/manual/advanced-topics/code-stripping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
