C#, .NET : hide DOS command-prompt window


In C# and .NET, I wrote an application that runs in a Form (using Windows.System.Forms). I use InnoSetup to install and I am able to start the application via Windows' Start button.

My problem: a DOS command-prompt window appears along with the Form. How can I prevent the DOS window from appearing?

Best Solution

Did you create the application using Visual Studio? If so, in the project properties, in the Application tab, there's a setting called "Output type". If this is set to "Console Application", a command-prompt window will appear when running the program, as well as the form. Setting it to "Windows Application" (the default for Windows Forms projects) will sort this out.

EDIT: Just saw your comment on the other answer. This setting corresponds to the "/target" switch for the compiler. /target:exe will give you the command-prompt, /target:winexe will just show the form. Hopefully anyway! I'm just going by the build output from Visual Studio.