microsoft / microsoft/microsoft-ui-xaml
ApplicationIcon for WinUI3 Unpackaged version
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### 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
```csproj
Assets\icon_name.ico
```
I have to use a small snippet of code to fix this "bug" :
```csharp
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:
> 
And here’s how it looks on the window bar:
> 
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
```csproj
Assets\icon_name.ico
```
2/ Run/Launch the application
Here’s how it appears on the taskbar:
> 
And here’s how it looks on the window bar:
> 
### Expected behavior
_No response_
### Screenshots


### 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_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the WinUI 3 unpackaged app with ApplicationIcon set in the .csproj, then compare its behavior with the LoadIcon snippet using AppWindow.SetIcon. Trace how the project setting is handled at launch; done means the configured icon appears on both the taskbar and window bar without the workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100