title: Sharing of Global In-memory Memory Mapped File
body: <p>We are trying to port the following code from .Net Framework to .Net Core.  The code creates an in-memory memory mapped file that is accessible by applications running under different logged in accounts (without admin privilege).  MemoryMappedFileSecurity class does not exist in .Net Core, how can I set up the shared memory mapped file?</p>
  
  <pre><code>var security = new MemoryMappedFileSecurity();&lt;br/&gt;
  security.AddAccessRule(new AccessRule&lt;MemoryMappedFileRights&gt;(
                                      "everyone",
                                      MemoryMappedFileRights.FullControl,
                                      AccessControlType.Allow));
  
  var memoryMappedFile = MemoryMappedFile.CreateNew(
                              "global\\SharedMap",
                              size,
                              MemoryMappedFileAccess.ReadWrite,
                              MemoryMappedFileOptions.DelayAllocatePages,
                              security,
                              HandleInheritability.Inheritable);
  </code></pre>
  
  <p>This is code which has been working for many years in .Net framework.</p>
  
  <p>Memory is created (without a backing file) by a Windows service.
  Memory is then accessed by desktop client apps, which are not admins.</p>
  
  <p>The security is needed, so that we can see the “admin” service memory from the desktop clients.</p>
  
  <p>We are trying to convert our system, piece by piece, to .Net core 3.0. This system includes 100s of components made in several of our factories, in various countries around the world. So, We cannot just “replace all code” at once. We cannot change the protocol used by the server.</p>
  
  <p>We have many years of experience with memory maps, but need to know what technology in .Net core is supposed to be equivalent to MemoryMappedFileSecurity?</p>