473,769 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using System.Diagnost ics.Process From ASP.NET

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

System.Diagnost ics.Process objProcess;
objProcess = new System.Diagnost ics.Process();
objProcess.Star tInfo.FileName= @"c:\WINDOWS\Mi crosoft.NET\Fra mework\v1.1.432 2
\gacutil.exe";
objProcess.Star tInfo.Arguments = " /if c:\MyDLL.dll";
objProcess.Star tInfo.RedirectS tandardOutput = true;
objProcess.Star tInfo.UseShellE xecute = false;
objProcess.Star t();
return objProcess.Stan dardOutput.Read ToEnd();

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 "UseShellExecut e" and the
"RedirectStanda rdOutput" lines,
It works, but I cant get the output of the gacutil!

Thanks ahead

--Ram
Nov 19 '05 #1
2 4008
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 "UseShellExecut e" and the
"RedirectStanda rdOutput" 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$******** ******@TK2MSFTN GP15.phx.gbl... Hey,
I'm trying to use the following code inside an ASP.NET project:

System.Diagnost ics.Process objProcess;
objProcess = new System.Diagnost ics.Process();
objProcess.Star tInfo.FileName= @"c:\WINDOWS\Mi crosoft.NET\Fra mework\v1.1.432 2 \gacutil.exe";
objProcess.Star tInfo.Arguments = " /if c:\MyDLL.dll";
objProcess.Star tInfo.RedirectS tandardOutput = true;
objProcess.Star tInfo.UseShellE xecute = false;
objProcess.Star t();
return objProcess.Stan dardOutput.Read ToEnd();

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 "UseShellExecut e" and the
"RedirectStanda rdOutput" 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$******** ******@TK2MSFTN GP15.phx.gbl...
Hey,
I'm trying to use the following code inside an ASP.NET project:

System.Diagnost ics.Process objProcess;
objProcess = new System.Diagnost ics.Process();

objProcess.Star tInfo.FileName= @"c:\WINDOWS\Mi crosoft.NET\Fra mework\v1.1.432 2
\gacutil.exe";
objProcess.Star tInfo.Arguments = " /if c:\MyDLL.dll";
objProcess.Star tInfo.RedirectS tandardOutput = true;
objProcess.Star tInfo.UseShellE xecute = false;
objProcess.Star t();
return objProcess.Stan dardOutput.Read ToEnd();

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
8375
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 a handler. The handler portion seems to fail indicating that my parameters are invalid. I am getting an error code 126 when i try to register the handler and 28 when i register for event notification. Any ideas as to what the deal is? I am...
4
5670
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 System.Diagnostics.Process class, for example: .... System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.EnableRaisingEvents = false;
0
3299
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? Is there something else that I need to do? Here is my code: System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo();
3
6903
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 ProcessStartInfo startInfo = new ProcessStartInfo ( cmd , param ) ; startInfo.CreateNoWindow = true ; startInfo.WindowStyle = ProcessWindowStyle.Hidden ;
1
6079
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 = System.Diagnostics.Process.Start ("cmd.exe", " /c echo y| CACLS C:\\Temp /E /T /G test:F");
1
3064
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. Now that works fine so far. My problem is that while tracert process is running and ASP ..NET is putting data into the pages output stream, my webapplication is locked until tracert process exits. How can I stop locking my application and be...
3
13382
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 using... ------------------
0
1804
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. anything to do different for windows server 2003? some special permission for the process that executes another executable with System.Diagnostics.Process.Start ?? here is the code:
5
8361
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 and store the file there for future reference.it will also print the contents on the printer attached on client machine. I M using dos command because other options requires manual file>print options to print the file and number of files is too...
4
8460
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: System.Diagnostics.Process.Start("http://www.microsoft.com/") It works if I do it like this (thank you HKW), but what if the user doesn't use IE, but uses some other browser?
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10208
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6662
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.