Conflict between cache keys in DefaultContentVersionRepository

Fixed in

EPiServer.CMS.Core 11.15.0


Feb 28, 2020


Mar 23, 2020


CMS Core


Closed, Fixed and tested


The following stack trace can be seen in error logs:

System.InvalidOperationException: Unknown object of type System.Object, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089 found with cache key EP:ContentVersion:11873. Expected type EPiServer.DataAbstraction.Internal.DefaultContentVersionRepository+CachedVersionList, EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7

The reason is that DefaultContentVersionRepository stores two kinds of objects in the cache. And, one of them can get a cachekey that matches the other kind. This results in a conflict and the raising of an InvalidOperationException.

The solution: ensure that different types of cached items have different types of cache keys.