TOC
“NetCore builds work cross platform without any issues.” And other lies you tell yourself before going to sleep.
NetCore is by now the best experience I’ve ever had with cross platform development but that has only been as long as stayed on the web development side of things. In web development I’m able to develop on my windows machine, push the code to an alpine build server that creates an alpine docker image to run on a linux docker host. Work on windows, build on linux and run on linux.
But with GUI development I foolishly thought: develop on windows, build on linux and run on windows, would work.
And the saddest part is I haven’t actually yet started on working on the actual cross platform implementation of my application yet. Yay.
My windows exe will always open a console window in addition to the GUI
So what gives?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
the WinExe
outputType is supposed to cause the exe to be a special windows exe that does NOT open a console…. Oh wait. something something “Special windows”.
Yeah that’s the issue. Any dotnet build
run on a linux distro just cannot append the windows special markers on the exe if I understood right. Trail that lead me to that conclusion was:
- some guy with the same issue https://github.com/dotnet/sdk/issues/11162
- other dude complaining about lacking certain windows exe meta data when building on linux: https://github.com/dotnet/core/issues/5338
- a still open issue describing that for some build operations legacy win32 apis are used. and I believe that this is the main issue tracking that: https://github.com/dotnet/runtime/issues/3828