StorageDevice.BeginOpenContainer Method

XNA Game Studio 4.0
Begins the process for opening a StorageContainer containing any files for the specified title.

Namespace: Microsoft.Xna.Framework.Storage
Assembly: Microsoft.Xna.Framework.Storage (in

public IAsyncResult BeginOpenContainer (
         string displayName,
         AsyncCallback callback,
         Object state


A constant human-readable string that names the file.
An AsyncCallback that represents the method called when the operation is complete.
A user-created object used to uniquely identify the request, or null.

Return Value

The IAsyncResult used to determine when the asynchronous request is finished.

Exception typeCondition
ArgumentNullExceptiondisplayName is null.
InvalidOperationExceptionA container is already open for the PlayerIndex set in BeginShowSelector. A new container cannot be opened until all previous containers used by this PlayerIndex are disposed.

After the container is opened, changes to the files within the container are cached until the container is disposed. For this reason, only one container per profile can be opened concurrently on the same device.

If the storage device is removed or the Xbox 360 console is powered down before the container is disposed, any changes are lost.

Call the Dispose method to dispose a StorageContainer.

Xbox 360, Windows 7, Windows Vista, Windows XP

Community Additions