consolecontrol icon indicating copy to clipboard operation
consolecontrol copied to clipboard

Stopping process throws error

Open longlostbro opened this issue 10 years ago • 1 comments

calling consoleControl.StopProcess(); from a wpf button or stopping the process from within the process causes an error in the following function.

<ConsoleControl.xaml.cs> public bool ShowDiagnostics { get { return (bool)GetValue(ShowDiagnosticsProperty); } set { SetValue(ShowDiagnosticsProperty, value); } }

An unhandled exception of type 'System.InvalidOperationException' occurred in WindowsBase.dll

Additional information: The calling thread cannot access this object because a different thread owns it."

longlostbro avatar Jul 09 '15 23:07 longlostbro

Very nice library, but i'm having the same issue.

foreach(ConsoleControl.ConsoleControl console in cmds.Keys) {
    if (console.IsProcessRunning) console.StopProcess();
    // some console.StartProcess code...
}

AtryFox avatar Aug 18 '15 20:08 AtryFox