AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.27k stars 2.19k forks source link

[Exception] Property Window (Icon) Linux(Fedora) #5300

Closed CarlosEX closed 3 years ago

CarlosEX commented 3 years ago

Describe the bug I'm using Linux with Fedora, the build so far works, but when I run the application generates me an Expected. The image is at the root of the application and I only referenced it in the Windows Icon property. What's missing?

To Reproduce Steps to reproduce the behavior:

  1. Add property Icon in Window (Icon="favicon.ico")
  2. dotnet run

Expected behavior Unhandled exception. System.IO.FileNotFoundException: The resource favicon.ico could not be found

Screenshots Screenshot from 2021-01-15 10-10-49

Desktop (please complete the following information):

kekekeks commented 3 years ago

You need to include your icon as <AvaloniaResource> in your csproj file and then use project-relative path (e. g. /favicon.ico)

CarlosEX commented 3 years ago

Thank you so much for the support. I did it like this, and they're not generating the exception anymore. However, no images appear in the form title. Am I making a mistake?

Screenshot from 2021-01-15 12-39-04

kekekeks commented 3 years ago

Are you sure that your desktop environment actually shows window icons? Does any other window has an icon?

CarlosEX commented 3 years ago

I didn't notice that. Actually the apps I have here, show a layout but I went to repair and are controls with icons. I believe that solves that issue. I am very grateful for the attention, I am very pleased with the results obtained so far. Screenshot from 2021-01-16 20-45-59