Re: ActiveX DLL COM object

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 06/25/04


Date: Fri, 25 Jun 2004 09:53:24 -0400

Mark,

    Giving full control to the IUSR account won't do anything, because by
the time your page is processed, it is occuring in another process, and that
process is running under the ASPNET local user.

    I think that the problem arises from the fact that the ASPNET account
doesn't have the rights to launch a new process, not that it doesn't have
rights to write to the directory.

    As a test, go to the web.config file for the directory that the page is
in, and add the <identity> element (setting impersonate to true). Add the
name of a user that has rights to spawn a new process and see if that works.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"vbMark" <no@email.com> wrote in message
news:Xns951362AD4FACBnoemailcom@130.133.1.4...
> "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote
> in news:#69uUhrWEHA.4092@TK2MSFTNGP11.phx.gbl:
>
> > Mark,
> >
> >     What are the permission errors that you get?  Even if you used a
> >     COM
> > object, you would still be running under the user that the page is
> > being processed under (unless you used a COM+ object, in which case
> > you can set the user that the object runs under).
> >
> >     How are you setting the user that the page is being processed
> >     under?
> >
>
> Here is the error message:
> "Error saving file: System.ComponentModel.Win32Exception: Access is
> denied at
> System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
> startInfo) at System.Diagnostics.Process.Start() at
> System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at
> System.Diagnostics.Process.Start(String fileName, String arguments) at
> converter.WebForm1.DoConvert(String sWorkingDir, String sFile) in
> c:\inetpub\wwwroot\converter\default.aspx.cs:line 33 at
> ASP.default_aspx.Button1_Click(Object Source, EventArgs e) in
> http://localhost/converter/default.aspx:line 33"
>
> What I am doing is a two step process.
>
> 1) Upload an image file (.jpg).  This works fine.  The file is written
> to the bin directory.
>
> 2) Run a command line argument on an executable that resides in the bin
> directory that converts the jpg into a gif.  This is where I get the
> error.  If I drop to a command line and test it the process runs fine.
>
> I right clicked on the bin directory and gave full control to ASP.NET
> Machine Account and IUSR Internet Guest Account.
>
> -- 
> http://www.vbmark.com/
> A good place to start.

Quantcast