# RegisterContentDirectory(string)

> Add the built-content in a directory to the ContentLoadManager. This makes it possible to load the contained Scenes and Assets.

## Definition

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

```csharp
public static ContentDirectoryHandle RegisterContentDirectory(string contentDirectoryPath)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A local path pointing to a directory that contains the output from a call to [BuildPipeline.BuildContentDirectory](/engine/6000.6/script-reference/unityeditor/buildpipeline/buildcontentdirectory.md).

### Returns

| Type                                                                                              | Description                                                                                   |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [ContentDirectoryHandle](/engine/6000.6/script-reference/unity/loading/contentdirectoryhandle.md) | A handle to the registered content directory, used to unregister it and to query its content. |

### Remarks

At runtime, call this for each content directory that [BuildPipeline.BuildContentDirectory](/engine/6000.6/script-reference/unityeditor/buildpipeline/buildcontentdirectory.md) produced and that you distribute alongside the Player, so that the scenes and assets it contains can be loaded. You can call it multiple times with different paths to register several content directories, but each directory is limited to a single build.

Match every call with a corresponding call to [ContentLoadManager.UnregisterContentDirectory](/engine/6000.6/script-reference/unity/loading/contentloadmanager/unregistercontentdirectory.md) once all loadables and scenes from the directory are released.

Any local file system path works, and Unity provides no mechanism or convention for discovering content directories on disk. The exception is content that ships with the Player, which you build into a subfolder of the `StreamingAssets` folder and locate at runtime through [\_streamingAssetsPath](/engine/6000.6/script-reference/unityengine/application/streamingassetspath.md). Refer to [Include additional files in a build](/engine/6000.6/manual/building-and-publishing/streaming-assets.md) for details.

In the Editor, registration is only supported in Play mode, where it lets you load and test built content the same way the runtime does. Outside of Play mode the content is already available through [AssetDatabase](/engine/6000.6/script-reference/unityeditor/assetdatabase.md), [LoadableObjectIdEditorUtility](/engine/6000.6/script-reference/unityeditor/loadableobjectideditorutility.md) and [LoadableSceneIdEditorUtility](/engine/6000.6/script-reference/unityeditor/loadablesceneideditorutility.md), so registration is unnecessary and throws InvalidOperationException.

To load built content in Play mode, build it with type trees. Content built with [BuildContentOptions.DisableWriteTypeTree](/engine/6000.6/script-reference/unityeditor/buildcontentoptions/disablewritetypetree.md) can only be loaded by a runtime that matches the build environment exactly, so the Editor cannot read it.
