What does HRESULT 0x80000021 (RO_E_CANNOT_ACTIVATE_UNIVERSAL_APPLICATION_SERVER) mean?

 
Could be also:
ConstantTypeOS
STATUS_SETMARK_DETECTEDNTSTATUSWindows
Previous Next
RO_E_CANNOT_ACTIVATE_FULL_TRUST_SERVER MSG_CI_CREATE_SEVER_ITEM_FAILED

RO_E_CANNOT_ACTIVATE_UNIVERSAL_APPLICATION_SERVER

Full-trust app cannot activate an incompatible universal WinRT server

RO_E_CANNOT_ACTIVATE_UNIVERSAL_APPLICATION_SERVER is HRESULT 2147483681 (0x80000021) from winerror.h. AllStat describes it as “A full trust packaged application process cannot activate a packaged WinRT server unless it is also declared to run full trust.” In the Windows Runtime metadata, object lifetime, asynchronous operation, activation, and apartment model, the code identifies a specific failure boundary and should not be replaced by a generic COM exception.

The hexadecimal value and symbolic name this result should remain attached to the originating API and operation generation.

Where it is encountered

  • C++/WinRT, WRL,.NET projections, or native WinRT ABI calls. Record the interface, method, component version, thread, apartment, process, and correlation ID.
  • Runtime-class activation, WinMD reflection, asynchronous objects, observable state, or view lifecycle.
  • Cross-thread and cross-apartment handoff between UI, ASTA, STA, MTA, broker, and background work.

The immediate focus for it is package activation where a full-trust process requests a packaged WinRT server that is not declared for full-trust activation. Keep it attached to that operation; the same numeric severity outside the owning API does not supply enough context.

Decisive interpretation boundary

Before choosing recovery, verify that the process identity and server manifest declarations show that the activation direction is unsupported. If this condition cannot be proven for it, stop before consuming outputs or repeating side effects.

Also confirm that all observed objects, tokens, buffers, proxies, metadata files, or ACLs belong to the current operation generation and were not retained from an earlier attempt.

Correct handling and recovery

Use a server declared for the caller trust model, introduce an app-service boundary, or activate from the supported application context. Preserve package isolation.

Reconcile partial output and server-side effects before attempting the operation again.

Lifetime, retry, and cleanup rules

After it, determine whether the current object, interface pointer, call context, token, stream, metadata reader, asynchronous operation, or access-control instance remains valid. Release only resources owned by the failing attempt, cancel callbacks through their documented mechanism, and avoid double close, double commit, repeated activation, or replay of a non-idempotent remote method.

The retry policy for it should state the trigger, maximum attempts, cancellation owner, and reconciliation step for effects that may have completed elsewhere.

Difference from nearby HRESULTs

It is the inverse trust-direction mismatch of RO_E_CANNOT_ACTIVATE_FULL_TRUST_SERVER.

A support tool discussing it should name the neighboring result only after the originating API and decisive state are known.

Practical scenario

A desktop process with package identity tries to activate a universal-only background server. The package adds a compatible service contract instead of bypassing activation policy.

A regression test should reproduce it, assert the raw HRESULT and all relevant outputs, then correct only the decisive condition and verify the intended success or neighboring failure result.

References


Looking for a different code? Search another status or error code.