locked
How can I pass Windows.Storage.ApplicationData.Current.RoamingSettings null error?

    Question

  • Hi,

    I deleted the folder of the app from C:\Users\User1\AppData\Local\Packages\Appname
    to see what happens when I insatall the app to a new user.

    In App.xaml.cs I have a null error at line:
     private Windows.Storage.ApplicationDataContainer roamingSettings =
               Windows.Storage.ApplicationData.Current.RoamingSettings;

    because RoamingSettings folder doesn't exist and I can't start the app.

    How can I solve the problem?
    Thanks


    ADRIAN DIBU

    Wednesday, February 12, 2014 6:13 PM

Answers

  • Hi adibu,

    Not quite understand why your delete the folder from your system to test the new installation. If a new user install the app, once the installation finish, all the folder should be copied or created in the right place, no need to worry about folder missing. See App packages and deployment for more. If you need a test with new installation for a new user, create a new user account in your PC.

    However, you could always use Try-Catch statement if you really need.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Jamles HezModerator Thursday, February 13, 2014 2:42 AM
    • Marked as answer by adibu Friday, February 14, 2014 12:23 AM
    Thursday, February 13, 2014 1:22 AM
    Moderator

All replies

  • Hi,

    I solved the block by delete bin and obj folders.

    Now the question is what I am doing when I deliver the app to the store?

    Thanks


    ADRIAN DIBU

    Wednesday, February 12, 2014 6:35 PM
  • Hi adibu,

    Not quite understand why your delete the folder from your system to test the new installation. If a new user install the app, once the installation finish, all the folder should be copied or created in the right place, no need to worry about folder missing. See App packages and deployment for more. If you need a test with new installation for a new user, create a new user account in your PC.

    However, you could always use Try-Catch statement if you really need.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Jamles HezModerator Thursday, February 13, 2014 2:42 AM
    • Marked as answer by adibu Friday, February 14, 2014 12:23 AM
    Thursday, February 13, 2014 1:22 AM
    Moderator