Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I tried to create some private variables that were SPUser's, but I was given an error to the tune of 'SPUser is not marked as Serializable'.

Why?

I know these objects contain a lot of contextual information that could be invalid when deserialized.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

My guess would be exactly what you suggest: those objects rely heavily on a valid SharePoint context in order to function. While you can obviously use the current context to serialize an object, there is no guarantee that you will have the same context (or any context) when it is being deserialized, which would leave the new object in an unstable state.

share|improve this answer
    
Does it mean that I can't serialize SPFile in web service? –  Rockie Feb 23 '12 at 13:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.