Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • I wanted to not show the console. While FreeConsole does what its name says, it doesn't prevent Windows from showing the console before it is called. Commented Aug 19, 2010 at 14:22
  • 5
    Then compile the project as a Windows Application, not a Console Application Commented Aug 19, 2010 at 14:37
  • 1
    For the record, this is exactly what I needed, thanks. It also is exactly what the title asks for :) So in the interest of other google voyagers, +1 Commented Jul 1, 2011 at 9:27
  • 4
    In addition [DllImport("kernel32.dll")] static extern bool AllocConsole(); allows you to easily run with a console from a standard Win32 application Commented Jul 1, 2011 at 10:01
  • 1
    Works for my .NET Core 2.2 app - if anyone is looking for this specifically. Commented Aug 25, 2019 at 12:22