Re: Generics in Cache



I have a class with List<AnotherClass> as a property.

Then I try to serialize my entire class with:

string ret = string.Empty;
using (MemoryStream ms = new MemoryStream())
{
SoapFormatter sf = new SoapFormatter();
sf.Serialize(ms, this);
ret = System.Text.Encoding.Default.GetString(ms.ToArray());
}
return ret;

And it blows up every time saying it can't serialize generics....
"Serializer does not support serializing Generic Types"


When I said cache I was actually referring to the HttpSessionState. I
thought if we were using StateServer that the objects were serialized to the
server running StateServer?


.



Relevant Pages

  • Re: Problem casting a byte[] to a class
    ... Normally you can serialize your class and desterilized but if the data needs ... to be in a compact byte array which I have found need for several times you ... converter.CopyBytes (val1, ret, 0); ...
    (microsoft.public.dotnet.languages.csharp)
  • [PATCH] ieee1394: dv1394: sem2mutex conversion
    ... int dma_running; ... to serialize various operations on the video_card. ... we still need to prevent multiple threads of execution ... return ret; ...
    (Linux-Kernel)
  • [PATCH 11/19] ieee1394: dv1394: sem2mutex conversion
    ... int dma_running; ... to serialize various operations on the video_card. ... we still need to prevent multiple threads of execution ... return ret; ...
    (Linux-Kernel)
  • Re: [PATCH] ieee1394: dv1394: sem2mutex conversion
    ... mutex_trylock follows the spinlock trylock convention, ... to serialize various operations on the video_card. ... we still need to prevent multiple threads of execution ... return ret; ...
    (Linux-Kernel)
  • Re: Serializing a Hashtable
    ... The first is that you don't really have to initialize the memory stream ... The other thing about this is that when you pass the byte array to the ... using (MemoryStream memoryStream = new MemoryStream()) ... // Serialize the instance. ...
    (microsoft.public.dotnet.languages.csharp)