1

I'm trying to get asp.net to run a console application on the server. I can get it to run with the following:

System.Diagnostics.ProcessStartInfo info = 
new System.Diagnostics.ProcessStartInfo(filePath, "");
Process processChild = Process.Start(info); 
info.CreateNoWindow = false;

What I need is for the console app window to appear. Currently it just runs as a process in the background.

Any ideas? Is this even possible?

3
  • Where do you want to see the console window? On the server? Keep it in mind that you are doing it using ASP.NET and everything is happening in the server and you can see nothing from the client machine. Commented Jul 20, 2011 at 9:21
  • Yes that is what I want (server). The console app will run for a long time and I'd like to be able to login to the server and check its status. I realise I could use the output in asp but i'd rather just have the console window open instead. Commented Jul 20, 2011 at 9:27
  • Have put CreateNoWindow = false before Process.Start but still doesn't show. Commented Jul 20, 2011 at 9:31

1 Answer 1

1

Nice, you are starting the process before setting CreateNoWindow to false. Do it like this instead:

System.Diagnostics.ProcessStartInfo info = 
new System.Diagnostics.ProcessStartInfo(filePath, "");
info.CreateNoWindow = false;
Process processChild = Process.Start(info); 
Sign up to request clarification or add additional context in comments.

4 Comments

..oh yeah. Just tried the other way around, still doesn't open. Can see it in the task manager though.
If you are seeing it in the task manager, what is the user name shown against the process? Probably you are logging in as a different user and not getting that session.
Ah I see. The user is the IIS Application. Thank you for your help. This guide shows how to specify a user, if anyone else needs to know.
@Simon: Right. The issue needed a bit of observation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.