# ContentDirectoryHandle

> A handle that references a registered content directory.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Loading](/engine/6000.6/script-reference/unity/loading.md)
* **Assembly:** UnityEngine.ContentLoadModule

```csharp
public struct ContentDirectoryHandle
```

## Remarks

This handle is returned from [ContentLoadManager.RegisterContentDirectory](/engine/6000.6/script-reference/unity/loading/contentloadmanager/registercontentdirectory.md). Keep the handle to call [ContentLoadManager.UnregisterContentDirectory](/engine/6000.6/script-reference/unity/loading/contentloadmanager/unregistercontentdirectory.md) after all loadables and scenes from that directory are released. Valid handles expose metadata such as [ContentDirectoryHandle.BuildName](/engine/6000.6/script-reference/unity/loading/contentdirectoryhandle/buildname.md) from the content manifest, and can be used to query root assets from a specific content directory via [ContentLoadManager.GetRootAssets](/engine/6000.6/script-reference/unity/loading/contentloadmanager/getrootassets.md).

Additional Resources: [ContentLoadManager.RegisterContentDirectory](/engine/6000.6/script-reference/unity/loading/contentloadmanager/registercontentdirectory.md)

## Examples

```csharp
using Unity.Loading;
using UnityEngine;

namespace BuildDocExamples
{
    public class ContentDirectoryHandle_RegisterUnregisterExample : MonoBehaviour
    {
        void Start()
        {
            string path = Application.streamingAssetsPath + "/DLC/MyContent";
            ContentDirectoryHandle handle = ContentLoadManager.RegisterContentDirectory(path);
            try
            {
                ScriptableObject[] roots = ContentLoadManager.GetRootAssets<ScriptableObject>(handle);
                // Load assets from roots, then release loadables and unload scenes before unregistering.
            }
            finally
            {
                ContentLoadManager.UnregisterContentDirectory(handle);
            }
        }
    }
}
```

## Properties

| Property                                                                                       | Description                                                                  |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [BuildName](/engine/6000.6/script-reference/unity/loading/contentdirectoryhandle/buildname.md) | The build name of the content directory (e.g. from the Manifest build name). |
| [IsValid](/engine/6000.6/script-reference/unity/loading/contentdirectoryhandle/isvalid.md)     | True if the handle is valid.                                                 |
