I have a WPF app with image resources. When I build the program, there is a directory named "resources" in the bin folder containing my images. If I run the program without the folder, it crashes. How can I embed the resources in the app so it can run stand alone?
Asked
Active
Viewed 3,511 times
1 Answers
7
You have to set the build action of the image files to Resource
, like shows here. The Uri for an image file named Image.png
would then be this:
pack://application:,,,/Resources/Image.png
See also the MSDN page Pack URIs in WPF.