Jump to content



Photo

Environment Makes Web App Code Fail (Srv 2008)

iis c# memorymappedfile com permissions

  • Please log in to reply
2 replies to this topic

#1 +_Alexander

_Alexander

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 21-January 13
  • Location: USA
  • OS: W8.1 u1
  • Phone: Nokia 521

Posted 13 June 2013 - 22:47

My problem is that IIS applications run in some sort of a "zone" which is drastically different from "ASP.NET Development Server" or running code outside of IIS.

Is there any way to set IIS to run Web Applications without limitations?

For example same code in a Console Application wil work without issues, but if I put it in a Web Application, it does fail.

Issues such as the temporary directory pointing somewhere the light doesn't shine or having no printer access are fixed by assigning a normal user to an Application Pool. Still,

Problem 1

On a development environment, if you launch an application (Process p = Process.Start(...)) on, say, Page_Load event, you will see that application pop up.

This doesn't happen on IIS. It hides the application nonetheless.

Problem 2

Some calls to COM seem to fail through IIS while working just fine when the same code is run via Console Application.

Problem 3

The Console Application from Problem 2 fails to run if launched in an Web Application via (Process p = Process.Start(...))

Problem 4

So considering that lots of code fails in IIS and applications launched via IIS are also dumbed down shells of their forme3 glory.

I tried using MemoryMappedFile to communicate between an limited proces on IIS and normal forms application which does rendering.

The thing is the MemoryMapped File is not accessible either on IIS.
I can't have a

MemoryMappedFile.CreateOrOpen("NAMEHERE", 1024 * 1024, MemoryMappedFileAccess.ReadWrite);

on IIS and access it from a different application on the Server - but it works just fine in development environment or between two normal applications.


Does anyone know how to launch a normal user environment process form IIS?
Does anyone know how to share a MemoryMapped file between IIS and anything else?
Does anyone know how to run Web Application in the same exact environment and permissions as a normal Application?

I really do not want to revert to writing communication data to disk so it could be shared between IIS Web App and a normal application - it was difficult and hard enough to get MemoryMappedFiles to work with Mutexes.


#2 Kami-

Kami-

    ♫ d(-_-)b ♫

  • Tech Issues Solved: 2
  • Joined: 28-July 08
  • Location: SandBox

Posted 14 June 2013 - 09:46

Web Development, you're doing it wrong.

#3 OP +_Alexander

_Alexander

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 21-January 13
  • Location: USA
  • OS: W8.1 u1
  • Phone: Nokia 521

Posted 14 June 2013 - 12:53

Web Development, you're doing it wrong.

Useful Comment - You are Doing it Wrong.

I do not have the luxury of making a normal application - so I have to work around IIS security and environment issues, somehow.

The most baffling this is that Memory Mapped Files are not accessible (or something?) when accessed from IIS or created in an IIS environment,
does anyone know how to create a Memory Mapped File in .NET 4.0 where they are properly accessible between IIS application and other applications?
I am going to ask Stack Overflow as well.

Edited by _Alexander, 14 June 2013 - 13:29.