You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image Source fails to load an image if application path has hash sign in it #6560
Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Problem description:
It is possible to specify Image source with relative path in XAML definition: Icon="Images/app.dark.png"
However, this definition fails to load image if the path containing application has # symbol.
Actual behavior:
In .Net 6
Fails in BitmapDecoder.SetupDecoderFromUriOrStream with System.IO.DirectoryNotFoundException
which transforms to exception going out: System.Windows.Markup.XamlParseException: "System.Windows.Baml2006.TypeConverterMarkupExtension" throws an exception."
Expected behavior:
We should load image with relative path without crash.
Minimal repro:
Create a WPF application
Add image in subfolder and specify its Build Action as Content and Copy to Output Directory as Copy or Copy if newer
Specify main window Icon image with relative path <Window x:Class="WpfApp1.MainWindow" Icon="Images/app.dark.png">
Yeah, as @lindexi mentioned this is a duplicate of #4781, hence we are marking it closed as of now and will keep tracking the bug from the original issue. Also, we will take a look at the PR #5066 from @lindexi, to get to a resolution.
Activity
lncubus commentedon May 9, 2022
Exception details
ex1.txt
lncubus commentedon May 10, 2022
A minimal example for .NET 6
LoadingImageSource_Net6.zip
A minimal example for .Net Framework 4.8
LoadingImageSource_Net48.zip
lncubus commentedon May 10, 2022
Original issue:
microsoft/PowerToys/issues/17652
lindexi commentedon May 11, 2022
@lncubus Thank you.
Duplicate of #4781
And I fixed it in #5066
dipeshmsft commentedon May 18, 2022
Yeah, as @lindexi mentioned this is a duplicate of #4781, hence we are marking it closed as of now and will keep tracking the bug from the original issue. Also, we will take a look at the PR #5066 from @lindexi, to get to a resolution.