[GH-ISSUE #80] Hide console/terminal #51

Open
opened 2026-05-05 11:01:52 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @codec-abc on GitHub (Nov 11, 2018).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/80

Hi,
This is again a newbie question:

All tests I did on Windows had a console window that was around since the .Net Core project was a console one. While useful for debugging and such, this isn't something I want for release. Is there a way to not show (or hide) the terminal window?

Originally created by @codec-abc on GitHub (Nov 11, 2018). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/80 Hi, This is again a newbie question: All tests I did on Windows had a console window that was around since the .Net Core project was a console one. While useful for debugging and such, this isn't something I want for release. Is there a way to not show (or hide) the terminal window?
Author
Owner

@pauldotknopf commented on GitHub (Nov 11, 2018):

On Windows, there two ways to compile an app. You can compile as a "Windows Application" or a "Console Application".

GUI apps (WinForms, WPF) are typically compiled as a "Windows Application".

.NET Core currently doesn't support a way to compile in any other way than "Console Application", but there is a post-build step to achieve the same effect (since it's just a flag in the compiled exec).

Run this on your deployed app.

editbin.exe /subsystem:windows yourapp.exe

See here for more info.

Since .NET Core 3.0 will support WinForms and WPF, it will have the option of compiling as a "Windows Application", but until then, we need this post-build step.

<!-- gh-comment-id:437683566 --> @pauldotknopf commented on GitHub (Nov 11, 2018): On Windows, there two ways to compile an app. You can compile as a "Windows Application" or a "Console Application". GUI apps (WinForms, WPF) are typically compiled as a "Windows Application". .NET Core currently doesn't support a way to compile in any other way than "Console Application", but there is a post-build step to achieve the same effect (since it's just a flag in the compiled exec). Run this on your deployed app. ``` editbin.exe /subsystem:windows yourapp.exe ``` See [here](https://stackoverflow.com/questions/38776695/is-it-possible-to-run-net-core-console-application-silently-hide-console-windo) for more info. Since .NET Core 3.0 will support WinForms and WPF, it will have the option of compiling as a "Windows Application", but until then, we need this post-build step.
Author
Owner

@codec-abc commented on GitHub (Nov 12, 2018):

Thanks for the answer. By curiosity, how the program behave on Linux/Mac?

<!-- gh-comment-id:437829002 --> @codec-abc commented on GitHub (Nov 12, 2018): Thanks for the answer. By curiosity, how the program behave on Linux/Mac?
Author
Owner

@pauldotknopf commented on GitHub (Nov 12, 2018):

The binaries behave as you'd expect on Linux/Mac. It is only Windows that has this concept of "Windows application" vs "Console application".

<!-- gh-comment-id:437900419 --> @pauldotknopf commented on GitHub (Nov 12, 2018): The binaries behave as you'd expect on Linux/Mac. It is only Windows that has this concept of "Windows application" vs "Console application".
Author
Owner

@vadi2 commented on GitHub (Jun 26, 2019):

As of .NET Core 3.0, you can set <OutputType>WinExe</OutputType> in your csproj or pass /p:OutputType=WinExe as an argument to dotnet publish to avoid the console window.

<!-- gh-comment-id:505869653 --> @vadi2 commented on GitHub (Jun 26, 2019): As of .NET Core 3.0, you can set `<OutputType>WinExe</OutputType>` in your csproj or pass `/p:OutputType=WinExe` as an argument to `dotnet publish` to avoid the console window.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#51
No description provided.