dwmkerr / consolecontrol

ConsoleControl is a C# class library that lets you embed a console in a WinForms or WPF application.
MIT License
723 stars 169 forks source link

Can't Launch Node #41

Closed Rainboi64 closed 5 years ago

Rainboi64 commented 5 years ago

I am working on a web IDE that has node functionality, sadly can't open node

dwmkerr commented 5 years ago

Sorry can you leave more details? The exact issue you are seeing, how to reproduce, error messages, stack traces, anything which might help!

Rainboi64 commented 5 years ago

Hello, I am sorry that I didn't provide that much info, it's my fault, I was on a hurry Anyways I am using the control in windows form app (C#.net) to launch node.js, I tried using consoleControl.StartProcess("node") It just returned nothing, I tried to make a batch file to start it same problem, tried opening cmd then inserting node command. Sadly nothing worked. And I am very thankful that you are willing to help me, I really appreciate that, Thank You. But I made a Console App to call node.js and it worked so that's fine if my code can help you this is it :

// args 0 is node
// args 1 is arguments
   ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(args[0], args[1]);
//So it dosen't start in another window.
                myProcessStartInfo.UseShellExecute = false;
                myProcessStartInfo.RedirectStandardOutput = true;
                myProcess.StartInfo = myProcessStartInfo;
                myProcess.Start();
                StreamReader myStreamReader = myProcess.StandardOutput;
                // Read the standard output of the spawned process.
                while (myStreamReader.EndOfStream == false)
                {
                    string myString = myStreamReader.ReadLine();
                    Console.WriteLine(myString);
                }

                myProcess.WaitForExit();
                myProcess.Close();
Rainboi64 commented 5 years ago

I am very thankful for you anyways. BTW great work i really love your work and, I am amazed that this is open source thanks. My fault I didn't leave much info. As a student It's very awesome to see people helping you 😀

dwmkerr commented 5 years ago

Hi @YamanAlhalabi did you manage to solve the issue? I can take a look into this, might be a few days tho!

Rainboi64 commented 5 years ago

Yes, I did, I am having a problem which involves clearing the screen by using the

Console.Clear()

Excuting that would just crash the hosted app, can you please give me a way to clean it safely

dwmkerr commented 5 years ago

Excellent - what did you do to fix the Node issue? Do you have the stack trace of the error you are seeing for the Clear issue?

dwmkerr commented 5 years ago

I wonder if it is related to this #40

Rainboi64 commented 5 years ago

I provided the code above 😁

dwmkerr commented 5 years ago

Sorry, my bad! Will check into the clear issue shortly!