none
Compile error :Invalid Resx file

    Question

  • Dear sirs, I got a compile error when I delete an unused picture file in MyProject/Resource folder. How could I fixed it? Thank you.
    Sunday, April 30, 2017 11:56 PM

All replies

  • Hi TuongTA,

    Open a file "Resources.resx" in "My Project" folder of your project, and delete lines related to the picture you deleted.

    [sample of Resources.resx]
    <assembly alias="System.Windows.Forms" name="System.Windows.Forms, ...." />
    <data name="pct_Cake" type="System.Resources.ResXFileRef, System.Windows.Forms">
      <value>..\Resources\pct_Cake.png;System.Drawing.Bitmap, System.Drawing, .....</value>
    </data>
    <data name="pct_Coffee" type="System.Resources.ResXFileRef, System.Windows.Forms">
      <value>..\Resources\pct_Coffee.png;System.Drawing.Bitmap, System.Drawing, .....</value>
    </data>
    
    [sample]
    delete three lines per on picture you deleted.
    from <data name="xxxx".....> to </data>
    _____________
    Ashidacchi
    Monday, May 1, 2017 12:26 AM
  • I do this mostly by simply adding the picture again. 

    Be aware that the way the resources are handled is not in all versions of Visual Studio the same.


    Success
    Cor

    Monday, May 1, 2017 1:32 AM
  • Dear sirs, I got a compile error when I delete an unused picture file in MyProject/Resource folder. How could I fixed it? Thank you.

    I've had that happen to me and I can't say that know why but this is what I've done in the past:

    In "Resources", delete it:

    Also, look in Solution Explorer and you'll see that it's still there:

    Right-click and choose to remove it, then rebuild it.

    So far at least, that's worked for me. I hope it helps.


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Monday, May 1, 2017 2:14 AM
  • Hi TuongTA,

    I suggest you to first delete the resource from the Resources tab, then select Exclude from project in the Solution explorer and then delete the file.

    Best Regards,

    Cherry Bu


    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, May 2, 2017 10:02 AM
    Moderator