locked
Resource File Not Found error RRS feed

  • Question

  • From within  'Solution Explorer' I deleted an unused image file, 'EmptyBox.gif".  I had used this in testing while developing my code.  I carefully removed all references to this file in my code.  The file is not shown in 'Solution Explorer' and is not in the resource folder.

    However, when I attempt to run the program, I get the following error message:

    Error 1 Invalid Resx file. Could not find file 'C:\Users\admin\Documents\Visual Studio 2010\Projects\VB\Code\Code\Resources\EmptyBox.gif'. Line 147, position 5. C:\Users\admin\Documents\Visual Studio 2010\Projects\VB\Code\Code\My Project\Resources.resx 147 5 Code

    Clicking the error message opens the Resources.resx window.  Here I find a reference to the missing and deleted file:

    <data name="EmptyBox" type="System.Resources.ResXFileRef, System.Windows.Forms">
        <value>..\Resources\EmptyBox.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

    How do I fix this?  Should I create a new file, name it 'EmptyBox.gif" and simply copy it into the C:\Users\......\Resources folder?   Or should I create a new file and import it back into the Resources 

    Thursday, April 4, 2013 4:36 PM

Answers

  • Go to the Property pages of your project. On the left hand side, select "Resources". Here, delete the unused resource.
    • Marked as answer by Rellif Thursday, April 4, 2013 5:38 PM
    Thursday, April 4, 2013 5:02 PM
  • Thanks Sygrien

    The file was not shown in Solution Explorer - Resources.  However, I clicked My Project in Solution Explorer which opened 'Code X', then clicked the Resources tab and the file name was there with an ! mark.  I right-clicked the file and deleted it.

    Now everything works again.

    Thanks for putting me on the right track!

    • Marked as answer by Rellif Thursday, April 4, 2013 5:45 PM
    Thursday, April 4, 2013 5:45 PM

All replies

  • Go to the Property pages of your project. On the left hand side, select "Resources". Here, delete the unused resource.
    • Marked as answer by Rellif Thursday, April 4, 2013 5:38 PM
    Thursday, April 4, 2013 5:02 PM
  • Thanks Sygrien

    The file was not shown in Solution Explorer - Resources.  However, I clicked My Project in Solution Explorer which opened 'Code X', then clicked the Resources tab and the file name was there with an ! mark.  I right-clicked the file and deleted it.

    Now everything works again.

    Thanks for putting me on the right track!

    • Marked as answer by Rellif Thursday, April 4, 2013 5:45 PM
    Thursday, April 4, 2013 5:45 PM
  • Lütfen daha Açıklayıcı Anlatırmısın
    Friday, March 23, 2018 8:06 PM