vexe
vexe

Reputation: 5615

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?

Upvotes: 32

Views: 45226

Answers (2)

Riccardo
Riccardo

Reputation: 1520

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.

Upvotes: 5

Glenn Ferrie
Glenn Ferrie

Reputation: 10390

App Properties Window

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.

Option 2

Upvotes: 36

Related Questions