473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using System.Diagnostics.Process From ASP.NET

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\Microso ft.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
Nov 19 '05 #1
2 3990
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
"Ram" <ni***@bezeqint.net> wrote in message
news:O$**************@TK2MSFTNGP15.phx.gbl... 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\Microso ft.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"!
Thanks ahead

--Ram

Nov 19 '05 #2
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

William F. Robertson, Jr. wrote:
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
"Ram" <ni***@bezeqint.net> wrote in message
news:O$**************@TK2MSFTNGP15.phx.gbl...
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\Microso ft.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"!
Thanks ahead

--Ram


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: grutta | last post by:
I am writing a windows service that will recieve notification when a USB Device is insterted into the machine. I have used the RegisterDeviceNotification and the RegisterServiceCtrlHandlerEx with...
4
by: Ohad Young | last post by:
Hi, I need to open (launch) an external application from my winform application. The application is not a dot.net application, for example the windows calculator. I'm using the...
0
by: Daniel Reber | last post by:
I am trying to start a process from a windows service but when the process starts the command window that the process runs in never shows. Is this because I am calling it from a windows service? ...
3
by: vbMark | last post by:
Here is my C# code in the ASP.NET page. public static void DoConvert ( string sFile ) { string cmd = "foo.exe" ; string param = " /bar.txt" ; Process myproc ; // <-- Error here...
1
by: Morten | last post by:
Hi! Does anyone know why the code below always returns an "access is denied" error? private void Page_Load(object sender, System.EventArgs e) { System.Diagnostics.Process meProc =...
1
by: Heiko Besemann | last post by:
Dear group, I created an aspx page using System.Diagnostics.Process() to launch "tracert" from shell and redirect output to Response.Output which prints it as text/plain into my browsers window....
3
by: K.NagaKiranKumar | last post by:
Hi I have stucked up on a problem.... I am developing an application in VB.NET Here I have to put a button on a form and by clicking on that button, an exe should run. see the code I am...
0
by: Daniel | last post by:
System.Diagnostics.Process.Start fails on windows server 2003 the process returns process.ExitCode == 0 but executing any process with System.Diagnostics.Process.Start on windows xp works fine....
5
by: rohitkumar | last post by:
I am trying to build a web application which can execute dos print command on the client machine. This application will read a file stored in server and it will create a folder on client machine...
4
by: =?Utf-8?B?YmlsbA==?= | last post by:
i'm using VS2005, VB.NET windows forms application when I try to open a web page using process.start, i get an error: "application not found" I'm using this syntax: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.