RE: MembershipProvider is not marked as serializable?

RE: MembershipProvider is not marked as serializable?

am 31.03.2008 18:05:01 von brucebarker

in general a membership provider would not be serializable, as it has
database connections, etc. just marking an object serializable is not enough,
every public property must be serializable.

why would you store a memberhip provider in session, it should be a global
service.

-- bruce (sqlwork.com)


"Nemisis" wrote:

> Hi everyone,
>
> I have created a custom membership provider and set the serializable
> declaration on it, but for some reason i am still getting an error
> message saying
>
> "Type 'System.Web.Security.MembershipProvider' in Assembly
> 'System.Web, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable. "
>
> Does anyone know why? Is the MembershipProvider base class not
> serializable? Is there anyway of doing this?
>