Skip to content

App icon is not embedded when compiled on Ubuntu targeting Windows #48111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
o-mdr opened this issue Feb 10, 2021 · 3 comments
Closed

App icon is not embedded when compiled on Ubuntu targeting Windows #48111

o-mdr opened this issue Feb 10, 2021 · 3 comments
Labels
untriaged New issue has not been triaged by the area owner

Comments

@o-mdr
Copy link

o-mdr commented Feb 10, 2021

Description

I have a cross-platform console dotnet core 5.0 application, here's a relevant extract from the .csproj file

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <ApplicationIcon>main48.ico</ApplicationIcon>
  </PropertyGroup>
  ...
</Project>

When I publish it with dotnet publish on my laptop running Windows 10 x64, I get a foo.exe with the icon (yellow square).

image

When I publish it on the build machine running Ubuntu 18.04 LTS, the icon doesn't seem to be embedded correctly. When I download the published app from the build machine and open it in the Windows explorer, the icon is not there.

image

I am using the same source code, same project, but different platforms for the build.

I've also tried building the project on my laptop using VS Code with WSL Ubuntu 18.04 LTS. I observed the same outcome: binaries compiled on Ubuntu do not have an icon.

Affected commands:

dotnet build
dotnet publish
# Published as a single app or an app with separate dependencies

I expect that the icon gets embedded correctly during the build on Ubuntu, targeting Windows OS executables.

Configuration

  • Which version of .NET is the code running on?

dotnet core 5.0

  • What OS and version, and what distro if applicable?

Windows 10 x64, Ubuntu 18.04 LTS x64

  • What is the architecture (x64, x86, ARM, ARM64)?

Application is compiled as Windows x86

  • Do you know whether it is specific to that configuration?

Not sure

Regression?

Did not test in previous releases

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 10, 2021
@ghost
Copy link

ghost commented Feb 10, 2021

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@o-mdr
Copy link
Author

o-mdr commented Feb 10, 2021

Will this issue be better suited here https://github.com/dotnet/sdk? Apologies if this is the wrong repo

@jkotas
Copy link
Member

jkotas commented Feb 10, 2021

Duplicate of dotnet/sdk#3943

@jkotas jkotas marked this as a duplicate of dotnet/sdk#3943 Feb 10, 2021
@jkotas jkotas closed this as completed Feb 10, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants