By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

using System.Diagnostics.Process.Start

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.