I am using the releast version of AppFabric (as of 20 Oct 2010) against an Entity Framework 4 Code-First data model. As part of this, we are drawing items from SQL into POCO objects and storing those objects in AppFabric. We can store/retrieve items
with no problems.
When I recompile the code and try to retrieve an item (which I know is still in the cache), I get the following exception:
"The deserializer cannot load the type to deserialize because type 'System.Data.Entity.DynamicProxies.ACMEVersionHisto_0274F07D5CB3ECB757E0533C2AD895AD967B6E8D00FAB202E813E9C48E9493A5' could not be found in assembly 'EntityFrameworkDynamicProxies-ACME.Contracts,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Check that the type being serialized has the same contract as the type being deserialized and the same assembly is used."
I believe that the dynamic proxy classes used by EF4 to support the POCO model are recompiled with different signatures which are not backwards compatible with those items still stored in the cache - even though the structure of the class remains unchanged
(ie same properties/fields/etc). Makes sense I guess, but it makes these latest two MS technologies completely incompatible, which I find hard to believe.
Of note, we used to use the HttpRuntime.Cache for our caching requirements, and never had any problems.
Any help, much appreciated - thanks.