Using System.Diagnostics.Process From ASP.NET

R

Ram

Hey,
I'm trying to use the following code inside an ASP.NET project:

System.Diagnostics.Process objProcess;
objProcess = new System.Diagnostics.Process();
objProcess.StartInfo.FileName=@"c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
\gacutil.exe";
objProcess.StartInfo.Arguments = " /if c:\MyDLL.dll";
objProcess.StartInfo.RedirectStandardOutput = true;
objProcess.StartInfo.UseShellExecute = false;
objProcess.Start();
return objProcess.StandardOutput.ReadToEnd();

Even though I configured the projects virtual directory to run with a local
Administrator account,
I still get in the standardOutput stream: "Failed Registering Assembly,
Acess Denied"!

And when I mark the lines of the "UseShellExecute" and the
"RedirectStandardOutput" lines,
It works, but I cant get the output of the gacutil!

Thanks ahead

--Ram
 
W

William F. Robertson, Jr.

Since you are running this as an asp app, try changing the process model
section of the machine.config file. The username currently should read
"machine" and the password should be "autogenerated". Try changing it to
your local admin account and see if you can run it.
And when I mark the lines of the "UseShellExecute" and the
"RedirectStandardOutput" lines,
It works, but I cant get the output of the gacutil!

Mark the lines how? Comment them out?

bill
 
R

Ram

Hey Bill, thanks for your reply!
Yeah - when I comment this 2 lines,
The "gacutil" installs the chosen Assembly successfully...
I'll check out what you said about the machine.config...
Thanks again!

--Ram
 

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

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,092
Latest member
vinaykumarnevatia1

Latest Threads

Top