What does HRESULT 0x80040157 (REGDB_E_PACKAGEPOLICYVIOLATION) mean?

 
Previous Next
REGDB_E_BADTHREADINGMODEL CAT_E_CATIDNOEXIST

REGDB_E_PACKAGEPOLICYVIOLATION

A registration in a package violates package-specific policies

The native value 0x80040157 is REGDB_E_PACKAGEPOLICYVIOLATION, unsigned 2147746135 and signed -2147221161. The documented description is “A registration in a package violates package-specific policies”. Treat it as evidence that a COM registration inside a package violates package-specific policy; the operation in progress is processing packaged COM declarations or package-scoped registration.

Operational meaning

COM registration is architecture-, scope-, and identity-sensitive. A key visible in Registry Editor is not proof that the failing process sees the same view or that the values form a coherent activation contract.

  • Associate this result with one exact operation in CLSID/IID registry lookup, InprocServer32 or LocalServer32 metadata, interface proxy registration, package policy, and threading-model interpretation.
  • Confirm that this result came from processing packaged COM declarations or package-scoped registration, rather than from cleanup or a wrapper that ran afterward.

Cause model

  • It can result when the class attempts a registration form not permitted for its package type.
  • It can result when the manifest and registry metadata disagree about server, scope, or activation model.
  • It can result when an upgrade leaves machine-wide registration that conflicts with package ownership.

Troubleshooting workflow

  1. Identify the exact object, method, and lifecycle phase involved in processing packaged COM declarations or package-scoped registration.
  2. Record package family/full name, manifest class declaration, CLSID, server type, and deployment operation.
  3. Compare the package manifest with supported packaged COM rules.
  4. Inspect deployment diagnostics and remove only stale registration owned by the previous package version.

What to log

Correction strategy

Correction. correct the package manifest or deployment layout and redeploy the signed package; avoid bypassing policy with manual registry writes. Retry condition. Retry after package repair or removal of a verified ownership conflict, not after generic re-registration. Before repeating the operation, complete or roll back the installer transaction, re-read the exact user or machine registry view, and discard class factories obtained from superseded registration.

Practical scenario

A package declares an in-process server path outside its installed location; moving the binary into the package and updating the manifest satisfies policy.

Difference from related HRESULTs

REGDB_E_WRITEREGDB can be a permissions failure; it is an intentional package-policy rejection.

Developer and administrator guidance

References


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