-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataContractJsonSerializer failing in Microsoft.NetCore.UniversalWindowsPlatform 5.2.2 #17943
Comments
Thanks for opening the issue, @kpanwar. Can you please share a repro app with us? Thanks! |
@shmao - I sent you the app link |
Thanks for sharing the repro app, Kanishk. I was able to repro the issue on my box. It’s caused by a bug in the de-serialization code. The bug caused that types which are marked with [DataContract] but have non-public default constructor cannot be de-serialized. We will fix the bug. In the meantime, if you want to use "System.Runtime.Serialization.Json": "4.0.1",
"System.Runtime.Serialization.Primitives": "4.1.0",
"System.Runtime.Serialization.Xml": "4.1.0",
"System.Private.DataContractSerialization": "4.1.0" |
…t to build the two libs that we need to service for UWP (#14526) * Fix a Bug with Serializing Types with Non-Public Default Ctor. Fix #10374 * Adding System.Private.DataContractSerialization and System.Linq.Expressions to packages.builds * Follow-up changes to servicing S.Private.DataContractSerialization: - Updating the versions of assemblies and packages for System.Private.DataContractSerialization, System.Runtime.Serialization.Json, System.Runtime.Serialization.Xml for the servicing event. - Updating packages.builds to produce S.R.S.Json and S.R.S.Xml in additon so S.P.DCS since those are the 'public' libs that expose the changes in S.P.DCS. - There is an issue with servicing System.Linq.Expressions. I'm excluding it from packages.builds until I find a solution to the issue * Adding netcore50 configurations to System.Linq.Expressions again in order to ship rd.xml update. * Review feedback changes; setting S.Linq.Expressions version to 4.1.1 instead of 4.3.1, and rolling back ref assembly version update of S.R.Serialization.Xml
Our library is failing to deserialize blob of data when using Microsoft.NetCore.UniversalWindowsPlatform 5.2.2 in Visual Studio 2015. The deserialization works as expected for 5.1.0 and 5.0.0.
No parameterless constructor defined for this object. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at System.Runtime.Serialization.XmlFormatReaderGenerator.UnsafeGetUninitializedObject(Type type)
at ReadAuthenticationResultFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )
at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadJsonValue(DataContract contract, XmlReaderDelegator reader, XmlObjectSerializerReadContextComplexJson context)
at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns)
at ReadAuthenticationResultExFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )
at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadJsonValue(DataContract contract, XmlReaderDelegator reader, XmlObjectSerializerReadContextComplexJson context)
at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.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.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadObject(XmlDictionaryReader reader)
at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadObject(Stream stream)
at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(Stream stream)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResultEx.Deserialize(String serializedObject)
at Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache.Deserialize(Byte[] state)
at AdalCacheIssue.MainPage.d__1.MoveNext()
The text was updated successfully, but these errors were encountered: