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

Answers

  • 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 mod

    @BobHoward - The problem of any attempt to access the properties resulting in an exception was reported 18 months ago.
    See https://bugzilla.xamarin.com/show_bug.cgi?id=32116 . 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.name = ""; this.value = ""; } public NameValue(string sName, string sValue) { this.name = 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.