Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6895635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:56:02+00:00 2026-05-27T06:56:02+00:00

Im trying to persist some data but im getting an error here. Declaration of

  • 0

Im trying to persist some data but im getting an error here.

Declaration of isolated storage inside my public partial mainpage class

IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;

implementation of onNavigatedFrom

protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
    {
        settings.Add("list",listBox1.ItemsSource);
        settings.Save();
    }

When I hit the start button on the emulator I get a security exception:

System.Security.SecurityException was unhandled
Message=SecurityException

My listbox is binded to data coming from a xml. I´m using linq to xml to read it.

I have read a similar question here: SecurityException was unhandled when using isolated storage

But I could not understand what the person meant with “stored class needs to be marked public internals not allowed”.

Any help would be nice. Thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:56:03+00:00Added an answer on May 27, 2026 at 6:56 am

    When you save to the settings, you need to have a clear data type. In this case, you’re just saving the ItemsSource, but what is actually in the items source? That data needs to be publically knowable so that the serializer can serialize it. What data is in the ListBox? How is it defined?

    An IEnumerable (as such) also cannot be serialized, because the serializer needs to know what type to serialize it as.

    I’d recommend code like this:

        var data = (IEnumerable<MyDataType>)listBox1.ItemsSource; // perform the cast to get the correct type;
        settings.Add("list", data.ToArray()));
        settings.Save();
    

    This way, it’s in a nice clean datatype for the serializer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to persist some data that I get from a form in a
i am trying to persist two entities(with one to many relationship) using jpa but
I'm trying to setup Spring using Hibernate and JPA, but when trying to persist
I'm trying to insert some data into SQL from Excel VBA. The SQL commands
i am trying to insert some info into an sql server table but instead
I'm having some problems trying to plot two different data sets from stdin in
I am trying to persist member variables by saving them in the ViewState (only
I am trying to persist an Entity with a @Lob annotated String field. The
I'm trying to persist user settings to a configuration file using ConfigurationManager. I want
Am trying to determine the best way to persist information from an originating email,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.