| Previous | Next |
| E_ILLEGAL_METHOD_CALL | RO_E_METADATA_NAME_IS_NAMESPACE |
RO_E_METADATA_NAME_NOT_FOUND
Windows Runtime type or namespace was not found in metadata
RO_E_METADATA_NAME_NOT_FOUND is HRESULT 2147483663 (0x8000000F) from winerror.h. AllStat describes it as “Typename or Namespace was not found in metadata file.” 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.
Handling this result correctly requires the code-specific postcondition, not merely the fact that FAILED(hr) is true.
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 WinRT metadata lookup for a fully qualified name that is absent from the loaded WinMD set or package dependency graph. 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 spelling, namespace qualification, architecture, package version, and metadata search path match the component being activated or reflected. 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.
Difference from nearby HRESULTs
It means no matching metadata symbol exists; RO_E_METADATA_NAME_IS_NAMESPACE means the supplied name exists but denotes a namespace.
Tests for it should force both results and verify that object lifetime, output use, and user messaging differ.
Correct handling and recovery
Correct the type name or deploy the missing metadata dependency. Rebuild generated projections after metadata changes and avoid fallback to a similarly named type.
Repeat the operation after it only when the documented precondition, identity, apartment, object generation, buffer, or configuration has changed.
Practical scenario
A plug-in host requests <code>Contoso.Imaging.Decoder</code>, but the installed package exposes versioned namespace <code>Contoso.Imaging.V2</code>. Deployment and generated bindings are aligned to the same WinMD.
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.
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.
References
- Microsoft: C++/WinRT error handling
- Microsoft: concurrency and asynchronous operations
- Microsoft: WinMD files
- Microsoft: IAgileObject
- Microsoft: COM apartments
- Microsoft: HRESULT values
Looking for a different code? Search another status or error code.
