views:

572

answers:

2

I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code.

How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my resources and not have to have a duplicate file in my project...

thanks

A: 

The way that the adding of an application icon is that you must select it from the local file system, and then it is embedded into the application at build time. As far as I know it is not possible to have it first pull from a resource file.

Mitchel Sellers
I know that when I add it like regular (browse for it and select it), I get a foobar.ico file in my project.Once I build the project, my EXE has the icon set and there isn't a ico file in the folder.
Miles
Correct, to my point, you must reference it from the file system, it gets built in, but it is part of of something other than the default references that you are adding, .NET does it for you!
Mitchel Sellers
I reworded my response to hopefully make th epoint more clear
Mitchel Sellers
It is really sad when the correct answer got rated down.....
Mitchel Sellers
A: 

One solution I always use to prevent duplicate file references, is to create a solution folder such as "Project Dependencies". And then all refereces are made from that folder, so when building it pulls from the Project Dependencies folder.

This would work for resource files also, just copy them to the solution folder first and then drag them into your resource.

And for the assembly icon, just browse to the Project Dependencies folder as well.

Good Luck!

Jason Stevenson