none
Embedded image in Resource reported error ? RRS feed

  • Question

  • In C# VS2005 I embedded a picture (file in the form *.png) normal but when the rebuild was reported The "GenerateResource" task failed unexpectedly.
    System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI +. Have you know how to fix this ?
    Thursday, August 10, 2017 8:02 AM

All replies

  • Hello lamtriendong,

    I have embedded a new picture in my new project as you description .And every thing is working well ,my suggestion is that first you should check whether it is visual studio problem or code problem.

    you could create a empty project ,embedded picture and try to build the project.If success ,You could share more information about image related code so that I could do further test with it.

    There is some post that has the same question as yours , you could take reference with it.

    https://stackoverflow.com/questions/22491208/resx-file-produces-the-generateresource-task-failed-unexpectedly-exception

    Here is something that appears to describe your issue, Maybe you could consider ask for help from there.

    http://connect.microsoft.com/VisualStudio/feedback/details/530450/compilation-error-in-gdi

    Best regards,

    Feih_7


    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 11, 2017 10:47 AM
  • I read the link you sent me, but I have not applied what the article stated.
    The applications I use in design mode (in C# code) use winxp (32bit) to run very well but when passed to win7 (64bit) is reported error, VS2005 (32bit). In here. I send you my example Error on win7 (64bit) but winxp (32bit) is running fine, you try to see if I get the same error message, if still error i will make a video clip back to the wrong scene send you watch. I have an example image file embedded in the Resource runs very well but I resemble them they are error so I do not think VS2005 error. You see my attachment. http://www.mediafire.com/file/pgmme2vy9jfaxbl/vs2005.rar
    Get your response soon.
    Saturday, August 12, 2017 7:29 AM
  • Hello lamtriendong,

    I have tested your project and the error occurs as your mentioned ,the follow image shows that the steps to manipulate the picture.

    And I have noticed that some of your pictures seems that have been damaged ,Like the second picture in your resource folder.I'm not sure what caused the picture to ruin, And I’m sure that  the broken image is the reason why the program compiles does not pass.

    If you remove these damaged pictures it works well.

    Best regards,

    feih_7


    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.

    Sunday, August 13, 2017 8:16 AM
  • You have found the cause of the image file is defective. I do not think the image file is corrupted because running in winxp runs fine. Thank you so much for helping me.

    Can I ask you ? Example related to the article just above. In winxp Rebuild normal and running very well but switch to win7 you hit Rebuild not open the design form, can you look through help me? The program uses Net 2.0 and Devexpress 9.3.3. You see the attached file: http://www.mediafire.com/file/scsokzj9ex44qtk/ErrorOpenForm.rar


    Monday, August 14, 2017 3:51 AM
  • Hello lamtriendong,

    First you should try to remove the broken picture , I'm sure this broken image is the reason why the program compiles does not pass . And we aren't support for third party lib and complete project.

    The Visual C# forum discuss and ask the C# programming language, IDE, libraries, samples and tools . If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution .

    Best regards,
    feih_7


    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.

    • Edited by Fei Hu Wednesday, August 23, 2017 10:33 AM
    Wednesday, August 23, 2017 10:30 AM