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

In C # and .NET, I wrote an application that works in Form (using Windows.System.Forms ). I use InnoSetup to install, and I can start the application through the Windows start button.

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

+4
source share
2 answers

Did you create the application using Visual Studio? If so, in the project properties on the tab "Application" there is a parameter "Output Type". If this parameter is set to "Console application", when the program starts, as well as in the form, a command line window will appear. By installing it in the "Windows Application" (the default for Windows Forms projects), this will be done.

EDIT: just looked at your comment on another answer. This option corresponds to the "/ target" switch for the compiler. /target:exe will give you the command line, /target:winexe will just show the form. Hopefully anyway! I'm just going to execute the assembly output from Visual Studio.

+14
source

It looks like you compiled the application for the wrong purpose. You probably need to tell Visual Studio to compile it using a GUI executable, rather than a CLI executable.

You can do this in the project settings.

+7
source

All Articles