views:

148

answers:

2

I have an image that is used in some PDF files that my C# application generates. I know how to reference the image file when it is located in my workspace, but when I compile the program, I don't see the image anywhere in the compiled directory.

Can someone tell me what happened to that file, or do I have to manually package the file along with my program when I send the program to the users? I added the image to the workspace by drag-drop to the resource directory of one of my namespaces.

+2  A: 

Check the file's properties in Visual Studio. Have you set the CopyToOutputDirectory property to something besides Do not copy?

Michael Petrotta
+1  A: 

Hmm... I'm not sure about the whole drag-drop business, but if it's all working the resource will have been embedded into your assembly.

I suggest you have a look with Reflector - you can see the resources embedded within assemblies using that.

Have a look at the build properties for the item in Solution Explorer - in particular, if the build action is Embedded Resource then it will indeed be built into the assembly.

Jon Skeet
Thanks! I didn't change any of the settings from the default when I added the file to the project. I'll verify that they are set to what I need.
Elie