I'm basically looking for a way to pass instances through programs / processes without serializing instances in .NET 4.0.
Yes, I missed my good 100% insecure pointers;)
I thought that the new memory file integration in .NET 4.0 would help me by reading somewhere that you could use references / pointers "natively" using it.
However, when I try something like
var mmf = MemoryMappedFile.CreateFromFile(@"C:\temp\test.mp", FileMode.Create, "mmf",
1024*1024*300,
MemoryMappedFileAccess.ReadWrite);
var ss = new SimpleStruct();
ss.items = _items;
var FileMapView = mmf.CreateViewAccessor();
FileMapView.Write<SimpleStruct>(0, ref ss);
I get the following ArgumentException:
The specified Type must be a struct containing no references.
Is it possible to transfer links using MMF? If this is not the case, is there any way to pass instances around programs / processes?