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 7196873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:51:40+00:00 2026-05-28T20:51:40+00:00

I have an object and am trying to save it to the State dictionary,

  • 0

I have an object and am trying to save it to the State dictionary, but when i pass an object to it using :

State["name"] = object;

i see some exceptions being raised:

A first chance exception of type
‘System.Runtime.Serialization.InvalidDataContractException’ occurred
in System.Runtime.Serialization.dll A first chance exception of type
‘System.Reflection.TargetInvocationException’ occurred in mscorlib.dll
A first chance exception of type
‘System.Runtime.Serialization.InvalidDataContractException’ occurred
in System.Runtime.Serialization.dll

State does automatically serialize and deserialize for objects passed. What could be the problem?

I suspect that the object must use [Serialize] when the class is declared. i try to use [Serialize] on my class but it isn’t recognized although i have using System.Runtime.Serialization; declared and the reference exists

UPDATE

here is the class that i’m trying to serialize :

public class MeshObject
    {
        public ModelMesh mesh; // xna specific class
        public Matrix startOrientation; // xna specific class
        public Matrix Orientation; // xna specific class
        public bool isSetInPlace = false;
        public bool isSelected = false;
        public bool inPlay = false;
    }

UPDATE 2

from what i understand from this post, there is no [Serializable] in Silverlight. How can i resolve this problem?

  • 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-28T20:51:41+00:00Added an answer on May 28, 2026 at 8:51 pm

    As you can read here

    • The Serializable attribute is not available in WP7 (it is only needed for binary serialization anyway)
    • You can use XmlSerializer to Serialize and Deserialize
    • You’ll need to reference the “System.Xml.Serialization.dll” too.

    If you want to serialize a type that is not serializable you will need to implement the serialization yourself: http://mobile.dzone.com/articles/windows-phone-7-serialization

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

Sidebar

Related Questions

I have a problem when trying to save an inherited object using TemplateHibernate: Let's
I have been trying to check my arraylist to see if an object already
I'm trying to save a simple object in the database, but it's giving me
Hi, I am trying to save an object from a class I have created.
I'm trying to save some code with the following. I've an object with variables
I have a couple of domain objects which I am trying to save using
I have an object I'm trying to populate from another object (that is, iterate
I have an OLE COM object that trying to write a wrapper for, I
I'm trying to retrieve a document when I have an object id - however,
I am trying to have a javascript object tree behave like a php associative

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.