roy.d
roy.d

Reputation: 1129

Error serializing value

how to know where is this thing realy happen?

my abject are complicate for track and test each one , im sure there is a way to find the line of this problam no?

in my case im using viewstate that make this serialize , in my object there are some enum that are out of the class it might also made that issue?

PropertyInfo[] properties = GetType().GetProperties();
        foreach (PropertyInfo property in properties)
        {
            object[] attributes = property.GetCustomAttributes(typeof(PersistToViewState), true);
            if (attributes.Length > 0)
                ViewState[property.Name] = property.GetValue(this, null);
        }

        return base.SaveViewState();

Upvotes: 0

Views: 5018

Answers (1)

Aliostad
Aliostad

Reputation: 81680

With serialisation errors, you need to see the inner exception for the actual detail. The real detail could be deep 4-5 levels but is always descriptive enough to find out what is wrong.

Put the full error stack if you need more help.

Upvotes: 2

Related Questions