Search code examples
c#memory-mapped-filesmemory-mapping

Share object between two processes in C#


I'm looking for a way to share object between two processes. First process should create the object and the second should only copy it without making any change in the original.

Does anyone have an idea how to do that?


Solution

  • You don't need shared memory : the first process can expose a WCF (or .NET Remoting) service, and the second process will be able to call it. Make sure your object is serializable.