Create a Console/Window Hybrid Application in C#

We wanted to make our windows application(call ToolA) to be accessible for users from command line. We went the normal way and handled arguments that come to the Main method and things seem to be working. but we ran to an interesting issue

When we build ToolA as console application, What happens when I run as

  • ·Double click to start windows application : Command prompt also appear with the windows application and if you close the command prompt windows application also get closed. strange
  • console application with arguments :-No UI window is displayed  & all the information goes into command prompt.
  • console application with no arguments: UI of SSA application is open.

When we build ToolA as windows application, What happens when I run as

  • Double click to start windows application UI of SSA application is open.
  • console application with arguments :-No UI window is displayed. command prompt does not show any output.strange
  • console application with no arguments: UI of SSA application is open.

This article http://www.rootsilver.com/2007/08/how-to-create-a-consolewindow.html helped us to solve the problem. Example of a something we did not expect and came up at the last minute. Thanks to my team member Dhiresh for finding this solution

Advertisements