Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SecurityException was unhandled when using isolated storage

When using this code I get the above error:

        var userSettings = new UserSettings()
        {
            Username = TextBox_Username.ToString(),
            Password = TextBox_Password.ToString(),
            Operator = OperatorList.O2
        };

        var settings = IsolatedStorageSettings.ApplicationSettings;
        settings.Add("UserSettings", userSettings);
        settings.Save();

I'm not sure why? though.

like image 770
deanvmc Avatar asked Nov 17 '10 21:11

deanvmc


1 Answers

Fixed it. Any stored class needs to be marked as public marking classes internal is not allowed. The issue happened because C# does not default to public scope with new classes.

like image 109
deanvmc Avatar answered Oct 08 '22 15:10

deanvmc