Karthick
Karthick

Reputation: 31

.Ico file change in EXE - .NET winforms

I have an EXE which as Image1.ico as its Icon and i went to properties of the solution explorer->Application tab-> Selected Icon and Manifest and selected new image icon Image2.ico.

After i build and run the EXE, the EXE loads with old image icon (Image1.ico).

Any inputs on this?

Thanks in advance, Karthick

Upvotes: 3

Views: 2749

Answers (2)

t0mm13b
t0mm13b

Reputation: 34592

Check first for the icon and the resolution used for the icon. If it contains a 32x32 and a 16x16 image, then it could be that Visual Studio is messing up. To remedy this, saving the solution and close it, delete the EXEs in the 'bin\debug' and 'bin\release' directories. Re-open the solution and do a fresh build...

Upvotes: 0

John Knoeller
John Knoeller

Reputation: 34148

Windows will normally use the first icon it finds in the file. So if Image1.ico is still in your resources, you need to remove it.

Windows also has an icon cache, and it might be showing you the icon from the cache rather than the new one from your exe. If you change the name of the .exe file, does it show the old icon or the new one?

Edit:

Ok since the problem is that the icon cache needs to be flush. Here's instructions on how to do it on Win7 and Vista http://www.winhelponline.com/blog/how-to-rebuild-the-icon-cache-in-windows-vista/ For Windows XP you can use Tweak UI http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx

Upvotes: 1

Related Questions