I'm basically searching for a way to pass instances across programs/processes without serializing the instances, in .NET 4.0.
Yes, I'm missing my good ol' 100% unsafe pointers ;)
I thought the new integration of Memory-mapped files to .NET 4.0 would help me, having read somewhere that you could pass 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; //Collection of Items objects
var FileMapView = mmf.CreateViewAccessor();
FileMapView.Write<SimpleStruct>(0, ref ss); //Exception
I get the following ArgumentException:
The specified Type must be a struct containing no references.
Is it possible to pass references around using MMF? If it isn't, is there any way at all to pass instances around programs/processes?