Hi @Dagmawi Abebe ,
Thank you posting your questions.
Based on the published documentation, I could not identify a supported public-API procedure that independently verifies both removal of the exact per-user AppContainer profile registration and complete removal of its associated registry storage. I also found no additional documented guarantee specific to Windows 11 x64 build 26200.
Your retained creation evidence establishes provenance; the remaining limitation is the API contract for observing deletion.
-
DeleteAppContainerProfilereports successful profile deletion
DeleteAppContainerProfile defines S_OK as "The profile was deleted successfully." It also states that deleting a nonexistent profile returns success. Microsoft recommends closing all file handles in the profile storage locations before deletion because otherwise the storage locations might not be completely removed.
Closing those handles satisfies the documented recommendation, but there is no separate success result for registration removal versus registry/filesystem cleanup. If the call fails, the profile status is undetermined and Microsoft recommends calling the function again.
- Network-isolation enumeration is useful corroboration, but lacks a cross-API consistency contract
NetworkIsolationEnumAppContainers explicitly documents enumeration of all AppContainers created in the system. It should not be described as limited to running applications or applications using networking.
Its documentation nevertheless does not specify an atomic snapshot, synchronization with DeleteAppContainerProfile, a consistency deadline, or equivalence between its entries and the profile-registration resources managed by Userenv. Therefore, a successful enumeration with no matching name/package-SID/user-SID entry establishes absence from that enumeration result; it does not establish the stronger, independently verified registration-removal postcondition you are seeking.
The documentation also does not describe omission or retained-entry behavior following deletion, so it would be equally unsupported to assert that enumeration necessarily returns stale entries. NetworkIsolationEnumAppContainers
NETISO_FLAG_FORCE_COMPUTE_BINARIES concerns complete, current binary information. By default, binaries are not returned at all. It is not documented as a registration-refresh or deletion-completion barrier. NETISO_FLAG
- The registry API does not supply a named-profile observer
GetAppContainerRegistryLocation returns an HKEY for the current profile and accepts only the requested registry access mask. It has no profile-name, package-SID, or explicit-token parameter. Its documentation mentions user impersonation but does not provide a complete broker-side procedure for selecting an arbitrary named profile and subsequently checking its absence.
It also does not document an absent-profile result or guarantee noncreating behavior when storage is absent. Its documented E_INVALIDARG describes an unsuitable caller/access context, not profile absence. GetAppContainerRegistryLocation
Likewise:
- SID derivation provides identity without documented absence semantics. DeriveAppContainerSidFromAppContainerName
- Folder lookup provides a location rather than a complete resource inventory. Its only documented
E_INVALIDARGcase is aNULLparameter, and it resolves the app container from the thread token if one is set, otherwise from the process identity. GetAppContainerFolderPath
- Caller context, registry views, and error handling do not close that gap
RegOpenKeyEx can non-destructively test a known registry key, since it does not create the key if it is missing. Microsoft also recommends RegOpenCurrentUser instead of HKEY_CURRENT_USER when impersonating different users.
On 64-bit Windows, KEY_WOW64_32KEY and KEY_WOW64_64KEY select the corresponding registry views, and Microsoft recommends two passes when all keys in both views must be enumerated.
Those registry APIs do not, however, provide the missing supported mapping from a named AppContainer profile to a complete set of registration and storage keys that could be audited for absence.
And what can legitimately be asserted
A defensible assertion is:
The owned profile was successfully deleted according to
DeleteAppContainerProfile. A subsequent successful network-isolation enumeration contained no matching entry, and separately identified disposable resources passed their applicable absence checks.
The stronger assertion, that all registration records and associated registry/filesystem storage were independently verified as removed, is not established by these documented contracts. Supporting that requirement would need additional authoritative documentation covering exact resource binding and post-delete consistency/completion semantics.
If you need an authoritative, supported statement on whether Windows provides stronger guarantees for this publication pattern, including the concurrency and exact-file-identity cases described above, I’d recommend opening a support request with Microsoft through Support.
If you found my support helpful, I’d really appreciate it if you could follow this guide so others with similar issue can benefit as well.
Thank you.