我正在运行AppFabric Caching 1.1的问题。试试谷歌,但没有出现(或使用错误的关键字)
有以下情况:
我们遇到问题的对象是A类列表,A类有一些属性和B类列表。这两个类都有serialize属性和datacontract加上datamember。
在开发中,一切都按预期工作。我们从缓存中存储/检索/删除。
在测试中我们存储,但是当尝试检索时有异常。 例外是:
错误消息:未将对象引用设置为对象的实例。 堆栈跟踪:at System.Runtime.Serialization.TypeName.LoadTypeWithPartialName(ITypeName typeNameInfo,Assembly initialAssembly,String fullTypeName)at System.Runtime.Serialization.TypeName.LoadTypeWithPartialName(ITypeName typeNameInfo,Assembly initialAssembly,String fullTypeName)at System.Runtime.Serialization.TypeName.GetType(大会 initialAssembly,String fullTypeName)at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.ResolveDataContractTypeInSharedTypeMode(字符串 assemblyName,String typeName,Assembly&汇编) System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.ResolveDataContractInSharedTypeMode(字符串 assemblyName,String typeName,Assembly&装配,类型和输入) System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeInSharedTypeMode(XmlReaderDelegator xmlReader,Int32 declaredTypeID,Type declaredType,String name, 字符串ns)at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader,类型declaredType,String name,String ns)at System.Runtime.Serialization.NetDataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader,Boolean verifyObjectName)at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader,Boolean verifyObjectName)at Microsoft.ApplicationServer.Caching.Utility.Deserialize(字节[] [] buffers,Boolean checkTypeToLoad,Object context,IEnumerable1 knownTypes)at Microsoft.ApplicationServer.Caching.Utility.Deserialize(字节[] [] buffers,Boolean checkTypeToLoad)at Microsoft.ApplicationServer.Caching.RoutingClient.SendMsgAndWait(RequestBody reqMsg,IRequestTracker&跟踪器) Microsoft.ApplicationServer.Caching.DataCache.SendReceive(RequestBody reqMsg,IMonitoringListener监听器)at Microsoft.ApplicationServer.Caching.DataCache.InternalGet(String key, DataCacheItemVersion&安培;版本,字符串区域,IMonitoringListener 听众) Microsoft.ApplicationServer.Caching.DataCache<> c__DisplayClass49.b__48() 在 Microsoft.ApplicationServer.Caching.MonitoringListenerFactory.EmptyListener.Microsoft.ApplicationServer.Caching.IMonitoringListener.Listen [TResult](Func`1 innerDelegate)at Microsoft.ApplicationServer.Caching.DataCache.Get(String key)
修改 这些类使用Serialize和DataContract属性进行装饰。属性使用DataMember属性
进行修饰答案 0 :(得分:0)
要对它进行排序,我使用Protocol Buffer并自行进行序列化。 当我打开dll时,如果是字节数组,我会发现AppFabric旁路。