Skip to content

ApplicationIcon for WinUI3 Unpackaged version #10417

@qerdinger

Description

@qerdinger

Describe the bug

Hello,

Why doesn't the parameter ApplicationIcon in the .csproj file work as its name suggests with a WinUI3 Unpackaged App ?

MyProj.csproj

<ApplicationIcon>Assets\icon_name.ico</ApplicationIcon>

I have to use a small snippet of code to fix this "bug" :

private void LoadIcon(string iconName)
{
    this.AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, $"Assets/{iconName}.ico"));
}

When the LoadIcon function is not called, my application takes the default icon (Win32)

Here’s how it appears on the taskbar:

Image

And here’s how it looks on the window bar:

Image

Am I doing something wrong or is it a bug ?

Thanks
Quentin

Steps to reproduce the bug

1/ Set the ApplicationIcon parameter on the XAML file

<ApplicationIcon>Assets\icon_name.ico</ApplicationIcon>

2/ Run/Launch the application

Here’s how it appears on the taskbar:

Image

And here’s how it looks on the window bar:

Image

Expected behavior

No response

Screenshots

Image
Image

NuGet package version

Windows App SDK 1.6.3: 1.6.250108002

Packaging type

Unpackaged

Windows version

WIN11 10.0.26100.0

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions