DeletePackageDependency function (appmodel.h)

Deletes the install-time reference for the framework package dependency you created earlier by using the TryCreatePackageDependency method. This method informs the OS that it is safe to remove the framework package if no other apps have a dependency on it.


HRESULT DeletePackageDependency(
  PCWSTR packageDependencyId




The ID of the package dependency to remove.

Return value

Return code Description
E_INVALIDARG The packageDependencyId parameter is NULL on input.


Removing a package dependency is typically done when an app is uninstalled. A package dependency is implicitly removed if its lifetime artifact (specified via the lifetimeArtifact parameter of the TryCreatePackageDependency function) is deleted. Package dependencies that are not referenced by other packages are elegible to be removed.

The caller of this function must have administrative privileges if the package dependency was created using CreatePackageDependencyOptions_ScopeIsSystem.


Minimum supported client Windows 11 (introduced in 10.0.22000.0)
Header appmodel.h

See also


Use the dynamic dependency API to reference framework packages at run time