4

I try to call console appliction from asp.net when i put breakpoint in console app why it can't stop there.How can i call console application?

 var proc = Process.Start("D:\\Edefter\\EFaturaConsoleTxtParser\\bin\\Debug\\EFaturaConsoleTxtParser.exe", "/arg1 /arg2");
                proc.WaitForExit();
1
  • Do you want to run a console app on the server? Commented Nov 26, 2013 at 9:37

2 Answers 2

7

I'm not sure about this but anyway you can try

  ProcessStartInfo startinfo = new ProcessStartInfo();   
    startinfo.FileName =@"D:\\Edefter\\EFaturaConsoleTxtParser\\bin\\Debug\\EFaturaConsoleTxtParser.exe";   
    startinfo.CreateNoWindow = true;   
    startinfo.UseShellExecute = true; 
    Process myProcess = Process.Start(startinfo);
    myProcess.Start();
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for you answer it works clearly but i want to ask one question. When process is working i don't want to see console application window. startinfo.CreateNoWindow=true is relate with it but i console application window pop
7

While starting a process programmatically, the 'UserShellExcute' property must be 'false'. Otherwise, the CreateNoWindow property value gets ignored and new window is created.

Example:

 ProcessStartInfo startinfo = new ProcessStartInfo();
 startinfo.FileName = @"demoApplication.exe";
 startinfo.Arguments = "arg1 arg2";
 startinfo.CreateNoWindow = true;
 startinfo.UseShellExecute = false;
 Process myProcess = Process.Start(startinfo);

Source: http://msdn.microsoft.com

Comments

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.