How can I change the icon of a Console App in Visual Studio?

23,836

Solution 1

When you change the icon, does your project's Properties window look something like this?

   setting icon for console app in project properties

Make sure that you recompile (you might need to clean your solution first and then rebuild), and then that you're searching in the correct folder for your newly-built executable. If you're compiling in Debug mode, the default folder is (starting from the root level of your project's folder): \bin\Debug. If you're compiling in Release mode, it will be in \bin\Release.

Following the above steps, this works fine for me. My newly-created "ConsoleApplication1" gets a beautiful green book icon:

   Console application with custom icon

Make sure that you're looking at the right file! Only your executable (.EXE) is going to receive the custom icon treatment. The file that contains "vshost" in its name is used by Visual Studio, and the other files contain debug information, etc. Additionally, .DLL files cannot show custom icons—Windows uses the same icon for all DLLs and it usually looks something like two gears on a piece of paper.

If you still aren't having any luck, can you update your question with more details about what you're doing, specifically? I can't reproduce the problems you're experiencing otherwise.

Solution 2

I have the same problem. After trying to delete C:\Users\\AppData\Local\IconCache.db the new icon is shown as expected.

You can try it follow steps at: https://superuser.com/a/499083

Share:
23,836

Related videos on Youtube

Sean
Author by

Sean

Updated on July 09, 2022

Comments

  • Sean
    Sean almost 2 years

    I am working on C# Console App in VS 2008 and am unable to change the icon file.

    I changed the icon file in project-->properties-->application tab but still the old icon is displaying with the new build.

    Checked the below answer from a post to modify the .resx file. But my app has got only one .cs file and the .resx file is empty.

    Visual Studio, change app icon, how?

    • user1703401
      user1703401 over 13 years
      Project + Properties, Debug tab, untick "Enable the Visual Studio hosting process". Press F5. Now turn it back on when you see the icon.
    • Rick
      Rick almost 7 years
      What are the most annoying people on the internet? You find them in forums like this one here answering questions like "How do I do X?" with a snotnose comment like "Why would you want to do X in the first place?!!!!"
  • Sean
    Sean over 13 years
    Thanks for your answer cody. I've checked all the above steps and YES i do see the icon changed in the bin folder for the .exe. My problem is that am trying to publish this app and creating a desktop shortcut on user machine. So when i do this, the icon is not changing. Even if run a clean build, am getting the same problem. I've added the icon file under the "Icon and Manifest" option. but the desktop icon doesnt change even after publishing a new version. Tried to install this newly published version on a different machine for the first time even that didn't help. Assume icon is cached...

Related