Setting OutputType WinExe is not preventing a console host
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
**.NET Core Version: (e.g. 3.0 Preview1, or daily build number, use `dotnet --info`)**
Docker image [mcr.microsoft.com/dotnet/sdk:3.1](https://hub.docker.com/_/microsoft-dotnet-sdk))
**Windows version: (`winver`)**
[Github Hosted Environment](https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners#supported-runners-and-hardware-resources)
[Winders Server 2019 - OS Version: 10.0.17763 Build 1637](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md)
**Does the bug reproduce also in WPF for .NET Framework 4.8?:**
~Yes/No~ Did not test
**Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? If yes, please file the issue via the instructions [here](https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019).**
No, but it is working as intended when manually publishing on on my local machine (Windows 10 202h).
**Security issues and bugs should be reported privately, learn more via our [responsible disclosure guidelines](https://github.com/dotnet/wpf/blob/master/README.md#reporting-security-issues-and-security-bugs).**
-
**Problem description:**
The project is using `Microsoft.NET.Sdk.WindowsDesktop` with the `OutputType` set to `WinExe`. The produced executable from Github Workflow with Docker is opening the application with a console host.
```
WinExe
netcoreapp3.1
true
Common\Images\favicon.ico
...
...
...
```
**Actual behavior:**
The produced executable from our Github workflow is opening the application with a console host.
**Expected behavior:**
The produced executable should not open a console host.
**Minimal repro:**
100% on 20+ runs.
- Same actual outputs with publishing profile
- Old docker image `mcr.microsoft.com/windows/servercore:ltsc2019`
Contributor guide
Assessment
This issue has not been assessed yet.