I am trying run Run a WPF app as both UI and from command line. In command line mode, i am printing some text on console and later i am coming out of console control using the sendKeys as given below
Console.WriteLine("Printing Something here");
System.Windows.Forms.SendKeys.SendWait("{ENTER}");
FreeConsole();
but the line with SendKeys throws error while running. In command line mode the application crashes. however while debugging on visual studio i have seen the below message on a message box
Changes are not allowed while code is running
Please provide any hint on this, why is this throwing error. so that i can make necessary changes.
Thanks in Advance Sagar