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?

0

1 Answer 1

0

Try to use the Shutdown() function:

Application.Current.Shutdown(1); 

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks David. This is the correct answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.