Method UnpackAsync
UnpackAsync(String, String)
Unpacks a scene package file (.mspk) to an output directory.
Declaration
public static Task UnpackAsync(string mobileScenePackageFilePath, string outputDirectory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | mobileScenePackageFilePath | The path to a mobile scene package file (.mspk) |
| System.String | outputDirectory | The path to a directory to write the mobile scene package contents. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous unpack operation. |
Remarks
The unpack task writes the full content of the mobile scene package to the output directory. Care should be taken on devices with limited storage space, especially if the package is very large. After unpacking, you can remove the original .mspk file from the device.
Note that unpacking will fail if the package has expired and was authored as PreventExpiredAccess.
Exceptions
| Type | Condition |
|---|---|
| ExpiredException | Package was authored to prevent expired access. |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.5 - 100.15 |
| .NET 6.0 | 100.13 - 100.15 |
| .NET 6.0 Windows | 100.13 - 100.15 |
| .NET Framework | 100.5 - 100.15 |
| .NET 5 | 100.10 - 100.12 |
| .NET Core 3.1 | 100.7 - 100.12 |
| Xamarin.Android | 100.5 - 100.15 |
| Xamarin.iOS | 100.5 - 100.15 |
| UWP | 100.5 - 100.15 |
UnpackAsync(String, String, CancellationToken)
Unpacks a scene package file (.mspk) to an output directory.
Declaration
public static Task UnpackAsync(string mobileScenePackageFilePath, string outputDirectory, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | mobileScenePackageFilePath | The path to a mobile scene package file (.mspk) |
| System.String | outputDirectory | The path to a directory to write the mobile scene package contents. |
| CancellationToken | cancellationToken | A CancellationToken for canceling the unpack operation. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous unpack operation. |
Remarks
A package can contain data or functionality that can only be used when the package is unpacked. One reason
to unpack a scene packages is data content, raster files in particular require the package to be in an
unpacked format before the mobile scene package can be successfully loaded. Use
Esri.ArcGISRuntime.Mapping.MobileScenePackage.IsDirectReadSupportedAsync(System.String) to determine if a package needs to be unpacked. If the
last level of the outputDirectory is not present it will be created as part of the
unpack task.
Exceptions
| Type | Condition |
|---|---|
| ExpiredException | Package was authored to prevent expired access. |
Applies to
Platforms and versions
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.5 - 100.15 |
| .NET 6.0 | 100.13 - 100.15 |
| .NET 6.0 Windows | 100.13 - 100.15 |
| .NET Framework | 100.5 - 100.15 |
| .NET 5 | 100.10 - 100.12 |
| .NET Core 3.1 | 100.7 - 100.12 |
| Xamarin.Android | 100.5 - 100.15 |
| Xamarin.iOS | 100.5 - 100.15 |
| UWP | 100.5 - 100.14 |