0

I'm coding a C# application using WPF

i've a problem when i add a picture as resource in my project and use it as background for some items, in the execution i've an exception in the fonction InitializeComponent();

IOException : Cannot locate resource 'ressources/images/avatar-medecins_0.jpg'.

the image is located in the folder ressources/images and i already set it as ressource for the app this problem occurs with any picture i use !

enter image description here

enter image description here

  • my question was marked as duplicate, but when i saw the answers in the question, i've already done what they said and it doesn't work ! –  Apr 13 '18 at 09:41
  • So you mean there is a folder `ressources` (with double s) in your Visual Studio project, with a subfolder called `images`, and there is a file named `avatar-medecins_0.jpg` which has its Build Action set to `Resource`? Then how are you actually trying to use or load that image file? – Clemens Apr 13 '18 at 10:04
  • i use the avatar-medecins_0.jpg image as background of an ellipse. the image is loaded in the designer viewer, but while runing i've this exception ( and ressource with double s, because it is french ^^ ) –  Apr 13 '18 at 11:51
  • And is the folder structure `ressources/images/avatar-medecins_0.jpg` or just `ressources/avatar-medecins_0.jpg`, as implied by *"the image is located in the folder ressource"* ? – Clemens Apr 13 '18 at 11:58
  • yes ressources/images sorry ^^ there is no problem of Path, i've all checked ! the image is already here since the Designer Viewer shows it ! –  Apr 13 '18 at 12:59

0 Answers0