Using System.Diagnostics.Process From ASP.NET

  • Thread starter Thread starter Ram
  • Start date Start date
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
 
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
 
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
 
Back
Top