Error Spawning Process from ASP.NET

H

hoochiegooch

All,

I posted a message here recently regarding the difficulty
I'm having with CreateProcessWithLogonW() in an ASP.NET
application. I get the following Win32 error:

Error 183: Cannot create a file when that file already exists.

I thought it was Win2K3 or IIS6 giving me grief, but it
appears to behave the same way on a WinXP/IIS5 system.

I impersonated a domain admin and even wrote a small
test console app that is launched and logs the current
user info. This runs when spawned from another console
app (and has the correct new impersonation), but never
works from the ASP.NET app.

Is this kind of thing not permitted, no matter what
rights the user may have? I'm almost tempted to
create a simple .NET Remoting setup to do this
(and turn the 2nd app into a remoting server --
singleton -- which could work fine), but that seems
like a silly way to go.

Any ideas? I can provide more info if needed.

Thanks!
bn
 
J

John Timney \(ASP.NET MVP\)

Is the problem simply that the asp.net user only has read access to the Dir
when impersonated?

The asp.net account must have the rights to create the file, so it sounds
like your half way there as impersonation is usually the way to go.
However, you might want to use asp.net impersonation rather than
createprocesswithlogon and let the system worry about how the impersonation
works.

If you cant go this route, then ensaure everyone has file system access to
the dir you are creating in and tighten up from there once you have it
working.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
K

Kevin Spencer

What exactly IS CreateProcessWithLogonW? It is not a method or property of
any classes in the CLR.

Pretend we don't know anything about your app. We don't.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
H

hoochiegooch

Kevin said:
What exactly IS CreateProcessWithLogonW? It is not a method or property of
any classes in the CLR.

Pretend we don't know anything about your app. We don't.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

It's a Win32 API function. It appeared to be
the best way to impersonate across process
boundaries.

bn
 
K

Kevin Spencer

I would have to agree with John. Use the managed impersonation classes and
methods.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top