-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
- .NET Core Version: 6.0.4
- Windows version: Windows 11 21H2
- 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"> - Start an application and check everything is okay
- Rename the project path into
#WpfApp1 - Start an application
- Get an exception shown above
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done