Skip to content

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

@o-mdr

Description

@o-mdr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedNew issue has not been triaged by the area owner

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions