Closed
Description
- .NET Core Version: .NET 5.0
- Windows version: 21H1
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Problem description:
Application.GetContentStream() will fail if you place the executable in a path that contains "#".
Apparently, the paths after the "#" have disappeared.
Minimal repro:
For example, if you place the executable file and content file in "C:\FooBar\Path#Name\",
you will get the exception FileNotFoundException: Could not find file 'C:\FooBar\test.png'.
.
var uri = new Uri("/test.png", UriKind.Relative); // test.png is content file
var streamResourceInfo = Application.GetContentStream(uri); // <- Exception!!