Did not have to do a clean and rebuild. I tried every combination listed above (I am in VS2017)
- Go to Project->Properties->Resources
- Select File (drop down with choices of strings, images, icons...)
- Click Add Resource->Existing File
- Navigate to the image and import it
- VS identifies it as an image (mine is PNG) and switches the view to show Image resources
- Select the thumbnail of the image and in the Properties of the Image (type should be Bitmap) set Persistence to Embedded in resx
- I saved and closed Project Properties as I got confused here before
- Go to the Resources folder under the project and select the image (it should be listed for you)
- Select the image and set the BuildAction to Embedded Resource
- I set the File Action to Copy if Newer
From here I move back and forth between Debug and runtime, various combinations of clean, build and publish and the image has FINALLY been displayed every time.
Last tidbit, the XAML in the dialog looks like this:
<Image Source="pack://siteoforigin:,,,/Resources/DeathSpiral.png" />
I have updated several projects that were supposed to display graphics but didn't always do so using the steps above. They all work now. Tested in both VS2017 and VS2019 and no errors so far.