{"action":"created","issue":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet/issues/486","repository_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet/issues/486/labels{/name}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet/issues/486/comments","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet/issues/486/events","html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/issues/486","id":165391394,"number":486,"title":"MissingMethodException \"No parameterless constructor defined for this object\" when reading from token cache","user":{"login":"tseemann-xematec","id":1820825,"avatar_url":"https://avatars.githubusercontent.com/u/1820825?v=3","gravatar_id":"","url":"https://api.github.com/users/tseemann-xematec","html_url":"https://github.com/tseemann-xematec","followers_url":"https://api.github.com/users/tseemann-xematec/followers","following_url":"https://api.github.com/users/tseemann-xematec/following{/other_user}","gists_url":"https://api.github.com/users/tseemann-xematec/gists{/gist_id}","starred_url":"https://api.github.com/users/tseemann-xematec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseemann-xematec/subscriptions","organizations_url":"https://api.github.com/users/tseemann-xematec/orgs","repos_url":"https://api.github.com/users/tseemann-xematec/repos","events_url":"https://api.github.com/users/tseemann-xematec/events{/privacy}","received_events_url":"https://api.github.com/users/tseemann-xematec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-07-13T18:37:23Z","updated_at":"2016-08-02T00:26:45Z","closed_at":null,"body":"Hi there!\r\n\r\nAfter upgrading Microsoft.IdentityModel.Clients.ActiveDirectory from v3.10 to v3.12, we are experiencing an issue when serializing data to and from our token cache. We are using PCLStorage v1.0.2 for cross-platform access to local files.\r\n\r\nAfter completely deleting the cache file and retrieving a new security token from the Azure AD token provider, data gets saved to the cache with no errors. When reading from the cache afterwards, during a request to AcquireTokenSilently(), we encounter a MissingMethodException when deserializing the data read from the cache file.\r\n\r\nAny ideas would be greatly appreciated!\r\n\r\nException: System.MissingMethodException \"No parameterless constructor defined for this object.\"\r\n\r\nStack Trace:\r\n   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)\r\n   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)\r\n   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)\r\n   at System.Activator.CreateInstance(Type type, Boolean nonPublic)\r\n   at System.Activator.CreateInstance(Type type)\r\n   at System.Runtime.Serialization.XmlFormatReaderGenerator.UnsafeGetUninitializedObject(Type type)\r\n   at ReadUserInfoFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )\r\n   at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)\r\n   at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)\r\n   at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)\r\n   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)\r\n   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns)\r\n   at ReadAuthenticationResultFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )\r\n   at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)\r\n   at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)\r\n   at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)\r\n   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)\r\n   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, String name, String ns)\r\n   at ReadAuthenticationResultExFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )\r\n   at System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)\r\n   at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)\r\n   at System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)\r\n   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)\r\n   at System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)\r\n   at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)\r\n   at System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)\r\n   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)\r\n   at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadObject(XmlDictionaryReader reader)\r\n   at System.Runtime.Serialization.Json.DataContractJsonSerializerImpl.ReadObject(Stream stream)\r\n   at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResultEx.Deserialize(String serializedObject)\r\n   at Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache.Deserialize(Byte[] state)\r\n   at SeasNve.Runtime.Security.PersistentTokenCache.LoadData()\r\n   at SeasNve.Runtime.Security.PersistentTokenCache..ctor(String fileName)\r\n   at SeasNve.Runtime.Security.TokenAuthenticationProvider..ctor(String authority, String resource, String clientId, String redirectUrl, Func`1 platformParametersProvider)\r\n"},"comment":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet/issues/comments/236752401","html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/issues/486#issuecomment-236752401","issue_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-dotnet/issues/486","id":236752401,"user":{"login":"tseemann-xematec","id":1820825,"avatar_url":"https://avatars.githubusercontent.com/u/1820825?v=3","gravatar_id":"","url":"https://api.github.com/users/tseemann-xematec","html_url":"https://github.com/tseemann-xematec","followers_url":"https://api.github.com/users/tseemann-xematec/followers","following_url":"https://api.github.com/users/tseemann-xematec/following{/other_user}","gists_url":"https://api.github.com/users/tseemann-xematec/gists{/gist_id}","starred_url":"https://api.github.com/users/tseemann-xematec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tseemann-xematec/subscriptions","organizations_url":"https://api.github.com/users/tseemann-xematec/orgs","repos_url":"https://api.github.com/users/tseemann-xematec/repos","events_url":"https://api.github.com/users/tseemann-xematec/events{/privacy}","received_events_url":"https://api.github.com/users/tseemann-xematec/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T00:26:45Z","updated_at":"2016-08-02T00:26:45Z","body":"Ah, I see. So by forcing the project to use older versions of System.Runtime.Serialization.* and System.Private.DataContractSerialization, we can still use the new Microsoft.NETCore.UniversalWindowsPlatform and ADAL packages.\r\n\r\nI just tried this and got rid of the compiler errors :) Hopefully, this doesn't cause any runtime issues because of incompatibility between these older packages and NETCore 5.2.2 ;-)\r\n\r\nThanks very much for your help!"}}
{"actor":{"display_login":"tseemann-xematec"}}