473,320 Members | 1,846 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,320 software developers and data experts.

using System.Diagnostics.Process.Start

Hi

I have an ASP.NET application. I am on the server side and trying to
start an application which is on the server. The process gets
started(can be seen in the Task Manager) but doesn't do anything(00
CPU cycles).

System.Diagnostics.Process.Start("c:\\Code\\testEx e\\test.exe");

Now I have gone to the testExe folder and given both ASPNet and
Network Service Read & Execute \ Modify rights to the folder and I
also added these two users to the Debugger group on my computer. I am
currently getting the error JIT Debugging exception -
System.UnauthorizedAccessException has occured.

Any ideas on this would be greatly appreciated. Also I read in one of
the forums that if you run an application this way which has GUI then
the GUI doesn't show up. Is that true? What could be a way around it?

Please let me know

Thanks

Sumeet
Aug 29 '08 #1
3 3175
re:
!The process gets started(can be seen in the Task Manager) but doesn't do anything(00 CPU cycles)

Could that be because you haven't instructed test.exe to do anything ?

You need to pass an argument to test.exe :
System.Diagnostics.Process.Start("c:\\Code\\testEx e\\test.exe", "argument");

See several code examples here :
http://msdn.microsoft.com/en-us/library/h6ak8zt5.aspx

Also, remember to kill the test.exe process when you're done.
That will prevent accumulating memory usage with each process instance started.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Bali" <su*********@gmail.comwrote in message
news:29**********************************@n38g2000 prl.googlegroups.com...
Hi

I have an ASP.NET application. I am on the server side and trying to
start an application which is on the server. The process gets
started(can be seen in the Task Manager) but doesn't do anything(00
CPU cycles).

System.Diagnostics.Process.Start("c:\\Code\\testEx e\\test.exe");

Now I have gone to the testExe folder and given both ASPNet and
Network Service Read & Execute \ Modify rights to the folder and I
also added these two users to the Debugger group on my computer. I am
currently getting the error JIT Debugging exception -
System.UnauthorizedAccessException has occured.

Any ideas on this would be greatly appreciated. Also I read in one of
the forums that if you run an application this way which has GUI then
the GUI doesn't show up. Is that true? What could be a way around it?

Please let me know

Thanks

Sumeet

Aug 29 '08 #2
asp.net runs as a service, as do any processes its starts. a service process
does not have access to the desktop, so any open window will fail. most gui
apps do not check if open window failed, so they just hang

if you need to run a gui app, then you should create a proxy process that
starts the app. you would need to run the proxy every time you log in (put ii
in start up). then asp.net can call this proxy to start the app.

-- bruce (sqlwork.com)
"Bali" wrote:
Hi

I have an ASP.NET application. I am on the server side and trying to
start an application which is on the server. The process gets
started(can be seen in the Task Manager) but doesn't do anything(00
CPU cycles).

System.Diagnostics.Process.Start("c:\\Code\\testEx e\\test.exe");

Now I have gone to the testExe folder and given both ASPNet and
Network Service Read & Execute \ Modify rights to the folder and I
also added these two users to the Debugger group on my computer. I am
currently getting the error JIT Debugging exception -
System.UnauthorizedAccessException has occured.

Any ideas on this would be greatly appreciated. Also I read in one of
the forums that if you run an application this way which has GUI then
the GUI doesn't show up. Is that true? What could be a way around it?

Please let me know

Thanks

Sumeet
Aug 29 '08 #3
Hi

Thanks for responding.

My exe is simply creating a file on the c drive and I have tested it
successfully.

I went under services -IIS Admin -Properties -Log On, selected
Allow service to interact with desktop and still got the same error. I
read that I might have to change the settings under which the ASP.NET
account operates in Machine.Config. I think that that would make the
machine much more vulnerable and is a security issue.

Any ideas?

Is proxy process another name for a windows service because to me in
concept it is sounding the same?

Please let me know.

Thanks

Sumeet

On Aug 29, 4:16*pm, bruce barker
<brucebar...@discussions.microsoft.comwrote:
asp.net runs as a service, as do any processes its starts. a service process
does not have access to the desktop, so any open window will fail. most gui
apps do not check if open window failed, so they just hang

if you need to run a gui app, then you should create a proxy process that
starts the app. you would need to run the proxy every time you log in (put ii
in start up). then asp.net can call this proxy to start the app.

-- bruce (sqlwork.com)
Sep 3 '08 #4

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...
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: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: andreas | last post by:
hi, In windows xp in the start launch menu when i put notepad "c:\test.txt" i get notepad with test.txt in it. in vb.net when i state system.diagnostics.process.start("notepad.exe" i get...
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...
13
by: Chris Johnson | last post by:
I have what seems to be such a simple thing yet I cannot figure out how to do it. I am using a streamwriter to build a text file. At the end of the process I want to open that same text file in...
2
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....
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.