in C# winform, how to attach a resource (an image for example) with the exe file?

I don't know if I asked it right, but basically what happened is that I made a winform app which loads its image from the resource folder .. the problem is that when i build the project and get the exe and give it to a friend, he won't have that resource folder like i do, so he'll get an error saying missing file.

How can I somehow mix, or combine, or attach the image with my app?


You need to add it to the project by navigating to the Properties Window and going to the resource tab and adding the image from there.

Alternatively, from the PictureBox Control you can import resource from your computer.

if you don't need to update it in the future, compile your program with the image property build action set to embedded resource. if you need to change it in the future compile with property build action set to content.

Need Your Help

Breaking down WinMain's cmdLine in old style main()'s arguments

c++ c windows winapi

I want to convert WinMain's cmdLine argument to argc and argv so I can use the argument parsing function I wrote for console applications.

Where is System.ServiceModel.Web.dll?

.net visual-studio-2010 wcf visual-studio

I am developing a Windows service that exposes a WCF service intended to be consumed by a Silverlight application, as explained in this blog post: