| Previous | Next |
| WCM_E_INVALIDLANGUAGEFORMAT | WCM_E_EXPRESSIONNOTFOUND |
WCM_E_KEYNOTCHANGEABLE
The Windows SDK describes the condition as “Not allowed to change value in a key member.”
Exact meaning and contract
A keyed-list identity member is immutable. The operation reached updating a member that defines the identity of an already created list element. The first branch to test is whether the caller uses SetValue on the list key instead of creating a new element; keep that separate from the possibility that a generic object mapper treats key and ordinary members identically.
Where the result appears
At this boundary, capture item setting type and GetKeyValue result, then correlate it with path of the list element and the schema’s key member. Assign ownership only after checking the update payload before field filtering.
Likely cause branches
- the caller uses SetValue on the list key instead of creating a new element
- a generic object mapper treats key and ordinary members identically
- migration code attempts to rename a keyed element in place
- the key value is included in a bulk update although it did not actually change
Evidence that resolves the ambiguity
- item setting type and GetKeyValue result
- path of the list element and the schema’s key member
- the update payload before field filtering
- whether a replacement element can preserve the remaining values
- references from other settings to the current keyed element
Diagnostic sequence
- exclude key members from ordinary update operations
- Create a new list element with the desired key
- copy non-key values through supported item APIs
- remove the old element only after reference and rollback analysis
- make rename semantics explicit in the application instead of simulating them with SetValue
Retry and recovery
No delay-based retry is appropriate. Recovery is a create/copy/remove workflow governed by list semantics.
Difference from nearby WCM results
WCM_E_READONLYITEM can block any immutable item. KEYNOTCHANGEABLE specifically protects the identity member of a list element even when its other members are writable.
Practical scenario
A network-settings tool tries to rename a keyed profile by assigning its key field. The correct operation creates a new profile element and migrates non-key properties.
Official Microsoft references.
Looking for a different code? Search another status or error code.
