This is a C# 3.0 Winform problem.
I want to clone a big(not very big actually), complicated object. To do it lazily, I seralize it to a MemoryStream and use BinaryFormatter.UnsafeDeserialize(MemoryStream, null) method to get the cloned object. Inside the UnsafeDeserialize() method, there is always an OutOfMemory exception thrown. The memory should be sufficient.
I read a bit about this as a .net bug but not sure whether it is the case here.
Anyone has any idea why this is happening? Any workround? Thanks.