Shobhit Maheshwari
Shobhit Maheshwari

Reputation: 37

C# Console application not showing console output when starting from different application

I am using a windows application to start a console application for command line parameters configuration.

When I am sending the command line parameters through debug mode, the application is working perfect, and all Console.WriteLine is printing to console, but when am starting the process from windows application of that console application it is not showing console output

the way, am starting the process is

           ProcessStartInfo procStartInfo = new ProcessStartInfo();

            procStartInfo.FileName = EXEName;
            procStartInfo.Arguments = FilePath;
            procStartInfo.RedirectStandardOutput = true;
            procStartInfo.UseShellExecute = false;
            procStartInfo.RedirectStandardOutput = true;
            procStartInfo.UseShellExecute = false;
            using (Process process = new Process())
            {
                process.StartInfo = procStartInfo;
                process.Start();

            }

Upvotes: 1

Views: 932

Answers (1)

Tóth Tibor
Tóth Tibor

Reputation: 1565

You need to set ProcessStartInfo.RedirectStandardOutput to false;

Upvotes: 1

Related Questions