The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
[UWP][XAML]Visual Studio 2017 Designer Using Old Image RRS feed

  • Question

  • I have several images (*.png files) in my app, which I use as the sources for some of the Image tags in my XAML code. However, after I replaced the images with newer ones, the XAML designer in Visual Studio 2017 is still using the old ones. I am assuming the designer has them cached somewhere (because I deleted them). If I use the new images with different names it is fine, but once I change the name back to the old one it uses the deleted file. I have tried closing Visual Studio 2017, closing the *.xaml file, even rebooting my computer. What can I do to make the designer use the new images instead of the old ones (wherever it is getting them from)?

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Thursday, August 24, 2017 8:46 PM

All replies

  • Is there any possible you only remove the image from the project instead of remove from the disk?
    Friday, August 25, 2017 12:49 AM
  • Should that make a difference? I think I did delete it completely, but is there any way to actually determine what it is using?

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Friday, August 25, 2017 12:56 AM
  • Hi Nathan Sokalski

    Could you please tell me the steps how you replace the old image? Do you replace the image directly in the folder with the same name? Or delete in the project first and then add an image with the same name to the project?

    Have you run the app and then check the xaml designer again to see if the image is correct?

    If it doesn’t work, please delete the obj and bin folder in your project folder and then clean the project and run again to see if the designer shows image correctly  

    Best regards,

    Roy 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 25, 2017 9:25 AM
    Moderator
  • I deleted the old image and then pasted in the new image file (which had the same name). Because that did not work, I tried renaming a copy of the file in Windows Explorer, copy & pasting that file into Visual Studio 2017. The file worked with the different name, but once I renamed it in Visual Studio 2017 the Designer immediately switched back to using the old file (NOTE: the file name is not anything unusual, it is just BlackTrain.png, it does not contain any special characters). Here are screenshots from design time & run time:

    I have tried deleting obj & bin, cleaning the project, and running it, but I still get the same problem. Any ideas?


    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    Friday, August 25, 2017 3:57 PM
  • @Nathan Sokalski

    I got the same issue. It shows the right image when I run the app. But if I closed the app, it shows the original one.

    I've reported this issue in the FeedBack of VS. You could see it with this link:

    https://developercommunity.visualstudio.com/content/problem/103499/vs2017-xaml-designer-shows-old-image-when-i-replac.html

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 29, 2017 11:52 AM
    Moderator
  • To remove a project item without deleting it from the disk, you have to "exclude from project" instead of "delete".

    I've got the same issue and commented in Roy Li VS Feedback.

    Wednesday, November 29, 2017 8:50 AM