Skip to content

A console opens although the OutputType WinExe is set #4659

Open
@TankB1

Description

@TankB1

Describe the Bug

I am using the image mcr.microsoft.com/dotnet/sdk:6.0 to publish a WPF desktop application as a standalone executable. In the .Net project file, the output type is set to WinExe. When I create and launch the application directly on my machine using the dotnet publish command, only the UI of the application launches as expected. If I create the application in the Docker container and start the application on my computer, the UI of the application opens and also a console window, although the output type is set to WinExe.

The behaviour I would expect, as described in the .Net documentation, would be that no console opens in addition to the application UI when the OutputType is set to WinExe.

Steps to Reproduce

Create a WPF-Project with Visual Studio. Configure the publishing profile as following:

<Platform>x86</Platform>
<PublishDir>bin\Release\net6.0-windows\publish\
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
<IncludeNativeLibrariesForSelfExtract>True</IncludeNativeLibrariesForSelfExtract>
<IncludeAllContentForselfExtract>True</IncludeAllContentForselfExtract>

Publish it with a container from the image mcr.microsoft.com/dotnet/sdk:6.0 and the command 'dotnet publish WpfApp1 -c Release /p:PublishProfile=WpfApp1/Properties/PublishProfiles/FolderProfile.pubxml'

Output of docker version

Client:
Cloud integration: v1.0.31
Version: 20.10.23
API version: 1.41
Go version: go1.18.10
Git commit: 7155243
Built: Thu Jan 19 17:43:10 2023
OS/Arch: windows/amd64
Context: default
Experimental: true

Server: Docker Desktop 4.17.0 (99724)
Engine:
Version: 20.10.23
API version: 1.41 (minimum version 1.24)
Go version: go1.18.10
Git commit: 6051f14
Built: Thu Jan 19 17:37:54 2023
OS/Arch: windows/amd64
Experimental: false

Output of docker info

Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.3)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.1.0)
extension: Manages Docker extensions (Docker Inc., v0.2.18)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.25.0)
scout: Command line tool for Docker Scout (Docker Inc., v0.6.0)

Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 20.10.23
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 19044 (19041.1.amd64fre.vb_release.191206-1406)
Operating System: Windows 10 Pro Version 2009 (OS Build 19044.2965)
OSType: windows
Architecture: x86_64
CPUs: 16
Total Memory: 15.23GiB
Name: NBSSC164OS
ID: ZGH6:W6IK:BERZ:TWRI:7C6U:2IM4:ITMI:TMO3:G2I7:LDAF:O4LQ:TOVB
Docker Root Dir: C:\ProgramData\Docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status

    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions