ApplicationIcon does not work when cross building win-x64 from Linux
See original GitHub issueHow to reproduce
On linux (using Buster 3.0.101):
dotnet new console
# Add myicon.ico to the project
dotnet publish --runtime win-x64 -p:ApplicationIcon=myicon.ico
Grab bin/Debug/netcoreapp3.0/publish/*.exe
Notice that the executable does not show any icon on windows explorer.
The same process on windows works as expected.
Expected
The executable should have the application icon properly set.
Workaround
Post process the .exe
with wine and rcedit.exe
.
https://github.com/btcpayserver/BTCPayServer.Vault/blob/abf575728b9b1f64bade6cd3a590ed8ac8baf6ee/Build/build.win-x64.Dockerfile#L28
Version
.NET Core SDK (reflecting any global.json):
Version: 3.0.101
Commit: bc5f8df0f5
Runtime Environment:
OS Name: debian
OS Version: 10
OS Platform: Linux
RID: debian.10-x64
Base Path: /usr/share/dotnet/sdk/3.0.101/
Host (useful for support):
Version: 3.0.1
Commit: 32085cbc72
.NET Core SDKs installed:
3.0.101 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Adding an icon issues when building from Linux for Windows
Hi,, I am trying to build an application from (Arch) Linux to Windows. I use this command cargo build --release --target ...
Read more >Creating a cross platform desktop app in .NET Core
Docker makes it easy to build everywhere. A big problem with creating installer is that each platforms requires very specific toolchains.
Read more >Can't Add Icon To Electron App With Electron Builder
How to fix: 1. Open https://www.electron.build/configuration/win 2. Search the option name on the page (or type in into Search to find across ......
Read more >.Net Core 2.1 produces .dll instead of .exe & ...
I have a .NET Core <Project Sdk="Microsoft.NET.Sdk"> Target framework = .NET Core 2.1 Output type = Console Application When I compile it I ......
Read more >Electron .net. How to set console app icon in linux.
Message displayed in VS Code terminal : default Electron icon is used reason=application icon is not set. While there is no icon. Only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Still not working on
net5.0
. Tested on Ubuntu and Docker (Dotnet SDK image)It would be nice if someone from Microsoft could respond to this about what the reason is and when it will be fixed.