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

  • Question

  • User253269 posted

    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?

    Wednesday, January 4, 2017 9:14 PM

Answers

  • User253269 posted

    Well, not sure if this is the recommended way, but I deleted some temp files (it is a Windows Universal project) from C:\Users\\AppData\Local\Packages\\LocalState and that got it working again.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, January 4, 2017 11:05 PM

All replies

  • User28549 posted

    is it in production like this?

    Wednesday, January 4, 2017 9:48 PM
  • User253269 posted

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

    Wednesday, January 4, 2017 10:01 PM
  • User253269 posted

    Well, not sure if this is the recommended way, but I deleted some temp files (it is a Windows Universal project) from C:\Users\\AppData\Local\Packages\\LocalState and that got it working again.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, January 4, 2017 11:05 PM
  • User28549 posted

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

    Wednesday, January 4, 2017 11:09 PM
  • User89714 posted

    @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.

    Wednesday, January 4, 2017 11:37 PM
  • User253269 posted

    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.

    Thursday, January 5, 2017 2:31 PM
  • User253269 posted

    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.

    Thursday, January 5, 2017 5:04 PM