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

Unhandled Exception: System.IO.IOException: The handle is invalid. #39

Closed aboodh95 closed 5 years ago

aboodh95 commented 5 years ago

Hi,

I'm getting this error once the console is launched,

dwmkerr commented 5 years ago

Can you paste the entire stack-trace please, and describe whether it is WPF/WinForms etc?

aboodh95 commented 5 years ago

Hi,

I'm using 1.1 V on WinForms Error Message: `Preparing to run C:\Users\Abood\source\repos\Server.Processes.Manager\InvoiceTaxTrigger\bin\Debug\InvoiceTaxTrigger.exe.

Unhandled Exception: System.IO.IOException: The handle is invalid.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded) at System.Console.Clear() at InvoiceTaxTrigger.Program.Main(String[] args) in C:\Users\Abood\source\repos\Server.Processes.Manager\InvoiceTaxTrigger\Program.cs:line 22

C:\Users\Abood\source\repos\Server.Processes.Manager\InvoiceTaxTrigger\bin\Debug\InvoiceTaxTrigger.exe exited.`

dwmkerr commented 5 years ago

Got it- can you try the latest version, 1.2.1?

On Sat, 6 Apr 2019 at 9:20 PM, Abood Hamwi notifications@github.com wrote:

Hi,

I'm using 1.1 V on WinForms Error Message: `Preparing to run C:\Users\Abood\source\repos\Server.Processes.Manager\InvoiceTaxTrigger\bin\Debug\InvoiceTaxTrigger.exe.

Unhandled Exception: System.IO.IOException: The handle is invalid.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded) at System.Console.Clear() at InvoiceTaxTrigger.Program.Main(String[] args) in C:\Users\Abood\source\repos\Server.Processes.Manager\InvoiceTaxTrigger\Program.cs:line 22

C:\Users\Abood\source\repos\Server.Processes.Manager\InvoiceTaxTrigger\bin\Debug\InvoiceTaxTrigger.exe exited.`

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dwmkerr/consolecontrol/issues/39#issuecomment-480503637, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1nSFS_z2MstMmNREzHFQTKHeLvkqymks5veJ8SgaJpZM4cczn9 .

aboodh95 commented 5 years ago

Hi,

1.2.1 is not showing for me image

dwmkerr commented 5 years ago

So sorry @aboodh95 you are right, I'd forgotten to publish the latest version! It's fixed now, you should be able to find it online now:

https://www.nuget.org/packages/ConsoleControl.WPF/1.2.1

aboodh95 commented 5 years ago

Hi,

Thank you so much, I installed it, but I got the same error, now with the line number in my code, at that line their Console.Clear();, since i comment that line it did work, so maybe you have to check that

dwmkerr commented 5 years ago

OK cool - I'm going to rename this issue and keep it open to see if I can get to the root cause.

Can you tell me exactly what line you commented out?

aboodh95 commented 5 years ago

Hi,

If you want i will close the issue and open another one