Development workflow for DLC
Refer to Downloadable content (DLC) packages documentation to find out more about how to configure DLC content, including how to make the association with the base game through the MicrosoftGame.config. There are three ways to install DLC:1. Loose DLC deployment
Install the directory pointing to your loose DLC MicrosoftGame.config and asset files: XBOX:2. Locally install DLC package
Install the .xvc/.msixvc created by makepkg: XBOX:3. Install DLC package from Store
With a test account signed into the dev sandbox, search for or direct link to the DLC product page in the Store app and install.Validate DLC installation
XBOX:get-appxpackage in PowerShell, note the Dependencies section:
Purchasing and installing DLC
Refer to the Basic store operations article to understand how to enumerate the catalog and offer the ability to purchase add-ons. Add-on products can be determined to be DLC by examining[XStoreProduct](/reference/system/xstore/xstore_members).hasDigitalDownload.
If a DLC is purchased from the Store, the DLC is queued to be downloaded.
If a DLC is purchased using XStoreShowPurchaseUiAsync, the DLC doesn’t queue for downloaded. Instead, the game should request a download manually following the code. Optionally a monitor can be created to track progress.
The package identifier is an opaque string that identifies a specific package. The identifier is unique per package, but different with each launched instance of the game. So, don’t store or reuse the identifier beyond the current session.
You can use the following methods to obtain the package identifier for a package, depending on the scenario:
- After calling XStoreDownloadAndInstallPackagesAsync to download and install packages, you can obtain package identifiers for those packages by calling XStoreDownloadAndInstallPackagesResult.
- You can obtain the package identifiers for packages already downloaded and installed by calling XPackageEnumeratePackages, then retrieving the package identifier from the XPackageDetails structure passed back to your XPackageEnumerationCallback callback function for each enumerated package.
- You can obtain the package identifier for the current game by calling XPackageGetCurrentProcessPackageIdentifier.
Enumerating DLC packages
Regardless of how DLCs are installed, the game needs to enumerate the installed DLC before use. Enumerating the installed DLCs is where the package identifier is obtained.Detecting that a DLC package is installed
Acquiring license for DLC
In development, see notes in Testing DLC licensing in development. The base game needs to acquire the license for DLC to determine whether it should give the user access to its contents. Games typically use Restrictive Licensing where after the game acquires the license for a package, access to the package is locked to that device and instance of the product. The game must release the license before another instance or device can acquire the access rights and license. Talk to your Microsoft Account Representative to ensure your game is configured to use Restrictive Licensing (not configured in Partner Center). For more information, see Open and restrictive licensing. Because the game must release the license, the game is responsible for tracking all DLC licenses it acquires and releasing them when they’re no longer needed or on termination. If the game fails to release a license, the license is released automatically after a timeout period.Determining license source of DLC
Using XStoreCanAcquireLicenseForPackageAsync or XStoreCanAcquireLicenseForStoreIdAsync (depending on the identifier type), it’s possible to determine if the DLC is- Licensable, so you can present purchase options if not
- Licensable by disc or by digital license
Mounting and unmounting DLC
Once the DLC license is successfully acquired, the DLC content can be mounted and accessed.Uninstalling DLC
Use XPackageUninstallPackage to uninstall a DLC package. The package must be unmounted first.Smart Delivery and DLC
It’s possible for XBOX Series X/S titles to license and mount DLC created for the XBOX One title. Typically, this scenario occurs when the DLC package doesn’t contain data used by the game. The only way to check is if the ERA DLC’sAllowedProduct ID in its package.appxmanifest, which is a GUID, matches the Legacy XBOX Product ID assigned to the product in Partner Center.
If not, the title was possibly migrated from the decommissioned XBOX Developer Portal (XDP), and only works with packages downloaded from Store, as the XBOX Series X/S version is assigned to the XBOX One’s product ID. For development purposes, see the note in the Troubleshooting section.
