# Sandbox.Resources.ResourceCompileContext.AddCompileReference

```csharp
void AddCompileReference(string path, bool optional = False)
```

Add a reference that is needed to compile this resource, but isn't actually needed once compiled.
Optional references may not exist - the compile won't fail without them, but if the file is
created or modified later we'll recompile.

### Parameters

- `path` (`string`)
- `optional` (`bool`), default `False`

Declared in [Sandbox.Resources.ResourceCompileContext](/api/Sandbox.Resources.ResourceCompileContext).
Assembly: `Sandbox.Engine`.
