| Previous | Next |
| CO_E_ERRORINAPP | CO_E_ERRORINDLL |
CO_E_DLLNOTFOUND
DLL for class not found
Meaning and numerical form
CO_E_DLLNOTFOUND is HRESULT 2147746296 (0x800401F8; signed -2147221000). For CO_E_DLLNOTFOUND, AllStat records its meaning as “DLL for class not found”. In practical terms, it is returned when COM resolves an in-process class registration but cannot locate the DLL named for that class.
The severity bit in 0x800401F8 is set, so CO_E_DLLNOTFOUND is a failure result rather than a success or informational status. Its facility is 4 (FACILITY_ITF) and its low 16-bit code is 504 (0x01F8). For CO_E_DLLNOTFOUND, those fields classify the value but do not identify the component instance, call, object or input that produced it.
Where the failure belongs
CO_E_DLLNOTFOUND belongs to COM activation and object lifetime. For CO_E_DLLNOTFOUND, COM activation is a sequence rather than one registry lookup: identifier resolution, class registration, module or process start, class-factory publication, marshaling, and object lifetime can fail independently. For CO_E_DLLNOTFOUND, the decisive condition is this: COM resolves an in-process class registration but cannot locate the DLL named for that class. For CO_E_DLLNOTFOUND, record the first native producer instead of relying only on a framework exception translated several layers later.
Do not infer from CO_E_DLLNOTFOUND alone that reinstalling, rebooting or repeating the whole workflow is appropriate. Because CO_E_DLLNOTFOUND can cross process and language boundaries, its correction depends on the object identity, lifecycle generation, input and state at the first failing call.
Evidence to collect
A useful CO_E_DLLNOTFOUND record includes the native API or interface method, component or CLSID, process and thread IDs, architecture, apartment where relevant, operation correlation ID, elapsed time, input identity, and the first state-changing event before failure. When diagnosing CO_E_DLLNOTFOUND, preserve IErrorInfo, an inner HRESULT, Win32 status, device event or provider message when available.
- Capture 1 for
CO_E_DLLNOTFOUND: the exact registered module path from the applicable 32-bit or 64-bit registry view. - Capture 2 for
CO_E_DLLNOTFOUND: file existence, access checks, architecture and deployment package identity. - Capture 3 for
CO_E_DLLNOTFOUND: loader diagnostics that distinguish a missing top-level DLL from a missing dependency.
Telemetry for CO_E_DLLNOTFOUND should retain types, lengths, hashes, stable opaque identifiers and lifecycle generations while redacting content and credentials. For CO_E_DLLNOTFOUND, this makes repeated incidents comparable without exposing paths, object identities, user data or credentials.
Likely causes
- Possible cause 1 for
CO_E_DLLNOTFOUND: the InprocServer32 path points to a file that was removed or moved. - Possible cause 2 for
CO_E_DLLNOTFOUND: the registration belongs to another architecture or installation root. - Possible cause 3 for
CO_E_DLLNOTFOUND: environment or side-by-side resolution differs between the working and failing process.
Diagnostic sequence
- Capture
CO_E_DLLNOTFOUNDat the first native return and identify the exact object and method. - Confirm that the observed path matches this
CO_E_DLLNOTFOUNDcondition: COM resolves an in-process class registration but cannot locate the DLL named for that class. - For
CO_E_DLLNOTFOUND, compare the live state with the method contract before changing configuration. - For
CO_E_DLLNOTFOUND, collect the code-specific evidence listed above and preserve any more specific preceding error. - For
CO_E_DLLNOTFOUND, change one evidence-backed cause at a time, then repeat the smallest operation that can prove the correction. - Add a regression check that distinguishes
CO_E_DLLNOTFOUNDfrom the related outcomes described below.
Practical scenario
A 32-bit client reads a stale 32-bit registration left by an old version while the new installer deployed only a 64-bit server; correcting the product installation resolves CO_E_DLLNOTFOUND. The CO_E_DLLNOTFOUND scenario narrows the result to a reproducible contract boundary and supplies a concrete before-and-after test.
Correction and retry boundary
- Corrective action 1 for
CO_E_DLLNOTFOUND: repair the product through its installer so registration and binaries are restored together. - Corrective action 2 for
CO_E_DLLNOTFOUND: select the registry view matching the client architecture. - Corrective action 3 for
CO_E_DLLNOTFOUND: avoid copying a DLL without its dependent runtime and supported registration steps.
Retry guidance for CO_E_DLLNOTFOUND. Retry after the registered path is corrected and the module plus dependencies are present; repeated CoCreateInstance calls cannot recreate a missing binary. A CO_E_DLLNOTFOUND retry must avoid this hazard: launch duplicate servers, reuse stale proxies or repeat an activation whose side effects are unknown. It must also preserve the evidence needed to locate the original producer of CO_E_DLLNOTFOUND.
Difference from nearby HRESULTs
REGDB_E_CLASSNOTREG means no usable class registration was found; CO_E_DLLNOTFOUND means registration was found but its DLL could not be located. For CO_E_DLLNOTFOUND, keep these outcomes separate in logs, exception mappings, user messages, dashboards and automated retry policy.
Developer and operational guidance
Code handling CO_E_DLLNOTFOUND should log the failed stage before cleanup, keep ownership and lifecycle transitions explicit, and avoid converting every failure into a generic message. Tests for CO_E_DLLNOTFOUND should cover the primary cause, one adjacent HRESULT and the retry boundary so a future change cannot turn a deterministic contract failure into an uncontrolled loop.
Operational repair for CO_E_DLLNOTFOUND should use supported product installation, COM registration, activation and class-factory lifetime paths. For CO_E_DLLNOTFOUND, avoid unsupported configuration edits or component replacement unless evidence identifies that layer. For CO_E_DLLNOTFOUND, retain the original trace and a post-fix trace so the result can be attributed and the change reversed.
Official Microsoft references
- Microsoft: generic COM error codes — official documentation relevant to
CO_E_DLLNOTFOUND. - Microsoft: CoCreateInstance — official documentation relevant to
CO_E_DLLNOTFOUND. - Microsoft: CoGetClassObject — official documentation relevant to
CO_E_DLLNOTFOUND.
Looking for a different code? Search another status or error code.
