I, WPF and Xaml-noob, have worked for console applications for me to just provide a relative path to the executable to access the file. It doesn't seem to work in xaml for me. (code below)
The absolute path works fine.
Is it possible in XAML in a WPF application to access the file simply by using the relative directory path of your executable file as a valid UriSource? If so, how and if not, why?
I found the following question where they talked about adding a file through Visual Studio "Add an existing item", so this seems like another problem.
How to set WPF property BitmapImage UriSource relative path?
<Window.Icon> <BitmapImage UriSource="C:\LongPath\SolutionFolder\ProjectFolder\bin\Debug\path4.ico" /> </Window.Icon>
Jennifer owens
source share