Search code examples
c#pictureboxembedded-resourceabout-box

I get an error when compiling with an imported image resource


This is turning into a nightmare!

I have a C# DLL project and it has the regular About Form. I go to add my own image:

enter image description here

I can see it listed and I accept:

enter image description here

It looks fine:

enter image description here

The moment I compile I get this error:

enter image description here

I have googled the error:

The argument docData must implement the interface IVsTextStream

And it suggests deleting the RES file.

I am confused. I thought this would be a simple exercise and despite several attempts and can't use my own image.


Solution

  • Well, I do not know why the problem was happening. But here is my workaround:

    1. I created a new C# DLL project.
    2. I added the About Form.
    3. I opened the form RESX file in the IDE.
    4. I added the new image.
    5. I set the image as embedded.
    6. I deleted the existing image.
    7. I renamed the new image the same as the old.
    8. I restarted the project and the image showed fine.
    9. I opened the RESX file with NotePad++ and copied the image bit over to my actual project about window RESX file.
    10. It displays and compiles.