Last post Aug 31, 2015 01:32 PM by chhenning
Aug 26, 2015 10:30 AM|chhenning|LINK
I need to access a memory mapped file from one of my routes in my Web API. Using the normal IIS worker settings I have no luck and my service always returns "File not found". I tried to add the prefix "Global/" but still no luck.
After reading many hours on the web I learned that I need to change the Identity of the IIS worker. So, just for testing purposes I changed the worker identity to the Administrator account. I uploaded a picture here:
But still no luck. Does anyone here know how to configure IIS correctly?
Here is how I access the Memory Mapped File using c#:
string Message = "";
string MMF_In_Name = "Global\\MMF_Name";
MemoryMappedFile MMF_In = MemoryMappedFile.OpenExisting(MMF_In_Name);
Messages.Add("Connected to MMF");
catch (Exception ex)
I have double checked the name of the memory mapped file and it's correct. A command line tool run as Administrator works as expected.
I'm using IIS 8.5 on Windows Server 2012.
Aug 27, 2015 02:49 AM|Li Wang|LINK
Thank you for your post. Could you please provide the code which create the Memory Mapped File? You need the set the name of Memory Mapped File start with "Global\" when create it.
Aug 27, 2015 09:16 AM|chhenning|LINK
Thanks a lot for your answer. I'll try your suggestion and report back.
Aug 31, 2015 01:32 PM|chhenning|LINK
I have posted my answer here:
Thanks again for your tip. It basically made me solve my problem!