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.

I screwed up my Application.Current.Properties now I am dead in the water

BobHowardBobHoward USMember ✭✭

I was playing around with adding stuff as a property and I added in a custom object that the serializer is choking on:

"The deserializer has no knowledge of any type that maps to this contract...."

Problem is that now I can't even touch the Application.Current.Properties without an exception, I try to Clear() , Remove(), and everything else I can think of and it always throws an exception and now my app is dead.

How can I get my Application.Current.Properties back?

Best Answer


  • ChaseFlorellChaseFlorell CAInsider, University mod

    is it in production like this?

  • BobHowardBobHoward USMember ✭✭

    No, I can't release it not working :(

  • ChaseFlorellChaseFlorell CAInsider, University mod

    just fix your code and delete the app from your test device then. Deleting the app will also delete the local storage.

  • JohnHardmanJohnHardman GBUniversity admin

    @BobHoward - The problem of any attempt to access the properties resulting in an exception was reported 18 months ago.
    See . If you have any information about how to get the problem to reoccur, can you add the info to that bug report please.

  • BobHowardBobHoward USMember ✭✭
    edited January 2017

    Sure, I will leave it here as well.

    I have a class called NameValue:
    public class NameValue { public NameValue() { = ""; this.value = ""; } public NameValue(string sName, string sValue) { = sName; this.value = sValue; } public string name { get; set; } public string value { get; set; } }

    When attempting to see what I can do with the properties, I was debugging and at a breakpoint, I added a List into the properties via the immediate window:

    Application.Current.Properties["BaseUrl"] = new List<NameValue>()

    It seemingly added it, but after that crashes.

  • BobHowardBobHoward USMember ✭✭

    I have narrowed it down to the C:\Users\\AppData\Local\Packages\\RoamingStatePropertyStore.forms file.

    That is an XML file and if you edit it and delete the bogus key it will work again.

Sign In or Register to comment.