Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8136671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:50:08+00:00 2026-06-06T10:50:08+00:00

We are having a strange problem with the Appfabric DataCache. Sometimes, 1 in 1000

  • 0

We are having a strange problem with the Appfabric DataCache. Sometimes, 1 in 1000 perhaps, we get exceptions from the cache Get method cache.Get(key); (public object Get(string key)). The exception is

Object of type
‘System.Collections.Generic.List`1[MyNamespace.PersonName]’ cannot be
converted to type ‘MyNamespace.StatusType’.

Why is it trying to do this conversion?? The StatusType Type has nothing to do with the PersonName Type, and its not in its object graph in any way.

This is internal to the DataCache, and as mentioned above, it will run for days with no issues, then sometimes it just starts throwing exceptions like this around. The objects(and object graphs) are all simple enough. And it does work 99% of the time.

Stacktrace:

at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
   at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
   at System.Reflection.RtFieldInfo.InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, Boolean doVisibilityCheck, Boolean doCheckConsistency)
   at System.Runtime.Serialization.FormatterServices.SerializationSetValue(MemberInfo fi, Object target, Object value)
   at System.Runtime.Serialization.FormatterServices.PopulateObjectMembers(Object obj, MemberInfo[] members, Object[] data)
   at Castle.DynamicProxy.Serialization.ProxyObjectReference.DeserializeProxyState()
   at Castle.DynamicProxy.Serialization.ProxyObjectReference..ctor(SerializationInfo info, StreamingContext context)
   at ReadProxyObjectReferenceFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )
   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns)
   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns)
   at ReadPersonFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] )
   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader, Int32 declaredTypeID, Type declaredType, String name, String ns)
   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, String name, String ns)
   at System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
   at System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)
   at Microsoft.ApplicationServer.Caching.Utility.Deserialize(Byte[][] buffers, Boolean checkTypeToLoad)
   at Microsoft.ApplicationServer.Caching.RoutingClient.SendMsgAndWait(RequestBody reqMsg)
   at Microsoft.ApplicationServer.Caching.DataCache.SendReceive(RequestBody reqMsg)
   at Microsoft.ApplicationServer.Caching.DataCache.InternalGet(String key, DataCacheItemVersion& version, String region)
   at Microsoft.ApplicationServer.Caching.DataCache.Get(String key)
   at MyNamespace.CacheManagement.AppFabricCacheProvider.Get(String key)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:50:10+00:00Added an answer on June 6, 2026 at 10:50 am

    Tracked this down eventually.

    This issue can occur, if you change the structure of your type, when a cached version of the same type is in the cache, and then try to retrieve a cached instance of the old type, on to your new type.

    In an environment with multiple developers working on the same types, sharing the same global cache, you’re bound to run into this.

    Never occurs in production, where the type interfaces would be static.

    Example

    public class Foo // version 1.0
    {
     public string Woof {get;set;}
     public FooBar Meow {get;set;}
    }
    // compile, run,
    // add an instance of Foo to AppFabric Cache, cacheKey = X
    

    // 5 mins later
    public class Foo // version 1.1
    {
     public int Id {get;set;} // change interface of type
     public string Woof {get;set;}
     public FooBar Meow {get;set;}
    }
    
    // compile, run, get an instance of Foo from the cache, cacheKey = X
    // exception, with strange information.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a strange problem: In -(void)viewWillAppear:(BOOL)animated method I use: [[UIApplication sharedApplication] setStatusBarHidden:YES
I'm having a strange problem with SSIS. I'm exporting some data from a database
I'm having a strange problem with ZeroMQ, in which some messages get stuck, and
I'm having a strange problem with cakephp. Im currently loading some data from the
I am having a strange problem. Whenever I do a AJAX request I get
I am having a strange problem, that when executing one method and my viewcontrollers
I am having a strange problem, maybe something to do with Apache more than
I'm having a strange problem with adding a UINavigationController to my iPhone application. I
I am having a strange problem ( well, at least i find it strange
I'm having a strange problem in that I have php inserting text into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.