简体   繁体   中英

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:

在此输入图像描述

I can see it listed and I accept:

在此输入图像描述

It looks fine:

在此输入图像描述

The moment I compile I get this error:

在此输入图像描述

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM