Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Problem with using Application.Current.Properties. Cannot access to Dictionary.

Stfn11Stfn11 PLMember

This is how I use it:

public partial class ConfigurationPage : ContentPage
        public const string storageLinesSelectors = "configurationLinesSelectorsJson";

        public ConfigurationPage()

        private void RestoreData()
            try { 
                IDictionary<string,object> properties =Application.Current.Properties;
                if (properties.ContainsKey(storageLinesSelectors))
                    var selectors = Application.Current.Properties[storageLinesSelectors] as string;
                    LoadedPreviousStateMessage.IsVisible = true;
            catch(AggregateException aex)
                foreach (Exception ex in aex.InnerExceptions)
                Debug.WriteLine("End of AggregateException");

The exact error which I get is System.AggregateException. This is what "try/catch" writes in debug console:

Error in line 1 position 206. Element '' contains data of the '' data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to 'ArrayOfstring' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.

I was following this tutorial and I've done everything exactly the way they recommended. Despite that, I see above-mentioned error. What do you think caused this and how can I fix it?

I use Xamarin Forms Application is being tested on Windows 10 Desktop.


  • X-ArielX-Ariel ARMember ✭✭

    Same issue at "UWP" (Xamarin.Froms When i get fix it, i will writ.

Sign In or Register to comment.