SerializationException when Casting Context.User to my Custom Principal object

Last post 09-09-2006 12:24 AM by sontek. 2 replies.

Sort Posts:

  • SerializationException when Casting Context.User to my Custom Principal object

    09-08-2006, 12:44 PM
    • Member
      302 point Member
    • sontek
    • Member since 01-29-2005, 7:53 PM
    • Salt Lake City, UT
    • Posts 64

    I'm getting this error randomly on my site: 

    Exception Details: System.Runtime.Serialization.SerializationException: Type is not resolved for member 'Authentication.CustomPrincipal,OrchidAuthentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

     By random meaning I can surf around  before it'll crash and then most of the time I can hit refresh and it'll work just fine again.   I have an HttpModule that sets the context.User to my principal on begin request.
     

  • Re: SerializationException when Casting Context.User to my Custom Principal object

    09-08-2006, 3:49 PM
    Answer
    • Member
      302 point Member
    • sontek
    • Member since 01-29-2005, 7:53 PM
    • Salt Lake City, UT
    • Posts 64
    I figured it out, It was because I had [Serialiable] on the object, why would that cause it to randomly not work?
  • Re: SerializationException when Casting Context.User to my Custom Principal object

    09-09-2006, 12:24 AM
    • Member
      302 point Member
    • sontek
    • Member since 01-29-2005, 7:53 PM
    • Salt Lake City, UT
    • Posts 64
    I recreated the issue, http://www.sontek.net/PrincipalSerialization.zip
Page 1 of 1 (3 items)