WPF - Image 'is not part of the project or its Build Action is not set to Resource'

后端 未结 10 1968
有刺的猬
有刺的猬 2020-12-29 20:26

I have a project which requires an image in the window. This is a static image and i added through \'Add>Existing Item\'. It exists in the root of the project.

I re

10条回答
  •  不思量自难忘°
    2020-12-29 20:49

    Try doing a full rebuild, or delete the build files and then build the file.

    Visual Studio doesn't always pick up changes to resources, and it can be a pain to get it recompile.

    Also try using a full URI as that helped me when I had the same problem. Something like

    pack://application:,,,/MyAssembly;component/bug.png
    

提交回复
热议问题