0

I've a WPF application which takes one command line argument. I'm calling this application from command window

E:\Kushal Ramesh\Projects\XMLToImage\bin\Debug>XMLToImage.exe TEST1

In my WPF app I'm able to read the arguments using

Environment.GetCommandLineArgs();

If the work gets completed as expected I've to send a positive response. I'm setting ExitCode of process to 1 in my WPF app

Environment.ExitCode = 1;

but my console window doesn't show any response!

Am I missing something here? Is there any other way of calling an exe from command window to receive response?

bluekushal
  • 499
  • 6
  • 14

1 Answers1

0

Try to use the Shutdown() function:

Application.Current.Shutdown(1);

There is an alternative, but more complex solution in this answer.

Community
  • 1
  • 1
Dávid Molnár
  • 10,673
  • 7
  • 30
  • 55