Quantcast
Viewing all articles
Browse latest Browse all 764

NetDataContractSerializer - Type is not resolved for member

We're trying to upgrade to the latest Csla 4.5 on .Net 4.0.  We're still using remoting for the time being and will at some future point move to WCF, but for now remoting it is.  I've hit a problem where the BinaryFormatter hangs when deserizlizing one of our types.  The odd part is that it does work the first few times, it only fails after a few back and forths.  So I'm trying to move us to the NetDataContractSerializer, which we'd use on WCF anyway.

My issue there is that immediately we get an exception (before any of the remoting even happens) when trying to serialize the very first type.  It fails with a SerializationException: Type is not resolved for member "ABC"  I've not been able to find any useful information, and its my understanding the NDCS should pretty much be a drop in replacement for BinaryFormatter and thus honor the Serializable / NonSerializable attributes. 

This failure is happening just running our unit tests over remoting, both in R# and in the NUnit GUI.  Here's a portion of the  stack trace (omitted parts are our code / remoting proxy calling into serialize the object):

at System.AppDomain.GetHostEvidence(Type type)
at System.Security.Policy.AppDomainEvidenceFactory.GenerateEvidence(Type evidenceType)
at System.Security.Policy.Evidence.GetHostEvidenceNoLock(Type type)
at System.Security.Policy.Evidence.RawEvidenceEnumerator.MoveNext()
at System.Security.Policy.Evidence.EvidenceEnumerator.MoveNext()
at System.Configuration.ClientConfigPaths.GetEvidenceInfo(AppDomain appDomain, String exePath, String& typeName)
at System.Configuration.ClientConfigPaths.GetTypeAndHashSuffix(AppDomain appDomain, String exePath)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Runtime.Serialization.Configuration.NetDataContractSerializerSection.TryUnsafeGetSection(NetDataContractSerializerSection& section)
at System.Runtime.Serialization.NetDataContractSerializer.get_UnsafeTypeForwardingEnabled()
at System.Runtime.Serialization.XmlObjectSerializerWriteContextComplex..ctor(NetDataContractSerializer serializer, Hashtable surrogateDataContracts)
at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContract contract, Hashtable surrogateDataContracts)
at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(Stream stream, Object graph)

Any ideas?


Viewing all articles
Browse latest Browse all 764

Trending Articles