I understand that there are problems regarding running a WPF application from a console window and outputting to the console rather than showing a gui (aka This Question).
The 'conclusion' of that question (which appears to be well researched and asked) is that it is possible to output from the application to the console, but it returns immediately - rather than blocking like a console application would.
However, looking at Visual Studio particularly the 'devenv.exe' process, this is exactly what it does manage to do:
- Double clicking on devenv.exe from within explorer runs the application gui only.
- From within a console (cmd.exe) window
devenv.exe<enter>
runs the Gui returning to the console immediatelydevenv.exe /?<enter>
displays the help within the console, only returning after all output has been displayed.devenv.exe test.txt<enter>
runs the Gui (loading test.txt) returning to the console immediately
So, it must be possible to have this behaviour in our own applications somehow! Does anyone know how?