Embedded resource not working

I want to add a picture as embedded resource to my project.

I choose Add Existing Item and browse to the picture, and then select Build Action as Embedded resource. I also select "Do not copy to output dir".

Upon recompiling I get:

Error 1 No destination specified for Copy. Please supply either "DestinationFiles" or "DestinationDirectory". C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets 1535 7 WindowsApplication1

This used to work for me until recently... I tried to reinstal Visual Studio on my computer but the same thing persists. It is also "not so funny" because the error message is not specific and I had to guess for 2 weeks, what happened to my solution. Since then I wasn't able to recompile it, since I use a lot of embedded pictures.

My next step would be to reinstall Visual Studio 2005 to some other machine and see if it works there.. but I don't have another machine at the moment, so I'm asking here if someone knows what could be happening.. was there a recent "automatic upgrade of visual studio" that broke this.. or something else broke the system on my computer

Thank you very much



Answer this question

Embedded resource not working

  • adhingra

    Correct.

    Ok, but now I tried it on the other computer and it works... hmm.. any ideas how should I uninstall VS in the way that this would get corrected As I said I tried to do it once but surprisingly the same thing keeps happening.

    Thank you

  • Meier

    I'm glad to read the problem is solved!

    Happy coding!


  • TRB

    no, I haven't done that... do you think that might work

    I have BitDefender ... I don't think that is interfering...



  • dblythe

    hmm ok then I guess I will have to try it myself on some other machine to make sure that something is definitelly wrong on this one..

    I am not sure what are those images you are talking about... thank you for helping

  • Busy Dragon

    Have you removed the complete .NET Framework also

    If not, you can try to remove Visual Studio and afterwards remove all .NET Framework version. But before you do that, do you have any strange virus scanners running Meybe it is blocking writing the exe file


  • X-Evolutionist

    Just the setup again and chouse the option to uninstall.

    When you create a new project, and you add an existing image to it and set the Build Action to Embedded Resource do you have the same exception/error


  • smurph

    yes, I did that again (uninstall and reinstall, but it didn't help).

    And yes, I tried to build a new project and do as you say.. and the problem is here.. that's interesting.. maybe I'll try to reinstall it again... I hope I won't need to reinstall entire system.. that would really hurt :(



  • Arsoft

    And every object that you add and for that object you set the Build Action to Embedded Resource you get this error


  • jdaddy18

    OK , I solved it! I reinstalled EVERYTHING...
    I think the reason was some program "MSBUILD something"... I forgot exactly how it was called and how it got there. I just uninstalled everything I suspected had something to do with Visual Studio..

    But interesting... my settings for VS persisted.. ok, all in all.. now it compiles, so thank you for guiding me!

    david

  • Yetii

    :) ah ok.. the .png images.. yes of course, I tried that..

    I would like to ask how can I *completelly* remove visual studio and reinstall it because I did try to reinstall it, but the same thing is happening.. I think the reinstall wasn't complete.

  • DWB007

    I don't have heard this before and everything works fine here with a up-to-date Visual Studio 2005.

    Have you tried to remove and add the images again


  • DJacobson

    I can't garrenty it would work, you can contact Microsoft if you think this is a bug, and i think it is. If it isn't you normally get an solution from them and if it is you can get an fix if it is available.

    You can contact them by phone, but a better approuch is the submit the bug here: Product feedback Center.


  • Embedded resource not working