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:
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.
Member
7 Points
22 Posts
Accessing Memory Mapped File from Web API
Aug 26, 2015 10:30 AM|chhenning|LINK
Hi all,
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:
http://imgur.com/MrA3byz
But still no luck. Does anyone here know how to configure IIS correctly?
Here is how I access the Memory Mapped File using c#:
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.
Thanks,
Christian
webapi
Star
9862 Points
974 Posts
Microsoft
Re: Accessing Memory Mapped File from Web API
Aug 27, 2015 02:49 AM|Li Wang|LINK
Hi chhenning,
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.
Best Regards,
Wang Li
webapi
Member
7 Points
22 Posts
Re: Accessing Memory Mapped File from Web API
Aug 27, 2015 09:16 AM|chhenning|LINK
Thanks a lot for your answer. I'll try your suggestion and report back.
Christian
webapi
Member
7 Points
22 Posts
Re: Accessing Memory Mapped File from Web API
Aug 31, 2015 01:32 PM|chhenning|LINK
I have posted my answer here:
http://stackoverflow.com/questions/32194172/how-to-commuicate-with-a-memory-mapped-file-from-a-web-api
Thanks again for your tip. It basically made me solve my problem!
webapi