1
votes

While I trying to get session like "Session[sessionKey]". The page shows "Cant't find the assembly App_WebReferences.fhdzc5d6, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null". I debug the page,I found when try to watch the key of session,it throw an exception "System.Runtime.Serialization.SerializationException". I don't know why this. please help me, thanks!

1

1 Answers

3
votes

If you are using StateServer as session provider or any other outproc session provider you need to mark all the classes as "Serializable" whose object you are setting in session.

Suppose you have a class named "UserIdentity" and you are storing object of UserIdentity in the session then you need to mark the class as "Serializable":

[Serializable]
public class UserIdentity
{
//
}

Hope this helps.