My goal isto have a WPF application run in both console mode and GUI mode. Everything worked fine until I realized that from command line it does not return back to prompt and neither is the exit code being set properly. Something similar to this post:
wpf console application not returning to prompt
So, I went through a workaround. I set the project output type to Console and things work good expect the fact that when double clicking to start the WPF application it shows both the GUI and a console window which is an annoying experience.
So, I am planning to hide that console window, but hide it ONLY if the WPF application was launched by double clicking. Is there anyway to find out if the WPF application was launched by double clicking ?