Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't change the icon of a console app in Visual Studio Community Edition

I am making a console app in using C# .NET version 4.5 in Visual Studio.

Whenever I try to add a 32x32 or 256x256 icon file (converted from 24-bit bitmap using MS paint) it says "C:\Users\ipass\Desktop\icon32.ico is not a valid icon file." I have tried using different icons, switching from a console app to a Windows app type, restarting my computer, moving the icon to a different directory, changing the icon of a different console app, and using SharpDevelop instead of Visual Studio. Nothing seems to be working.

Let me know if you need more info. I am attempting to change the icon by Right clicking the project in solution explorer>clicking 'Properties'>navigating to 'Application'>and clicking browse under 'Icon and Manifest'.

like image 457
Faux Bro Avatar asked Mar 09 '23 19:03

Faux Bro


1 Answers

If so it is probably giving the error because the actual file type is not what Visual Studio expects a .ico to be (the size of or information in the file header, for example). Also, the image may have to be a certain size, like 64x64 pixels.

You could try an online converter to convert an image file into a .ico file http://www.convertico.com/ http://www.icoconverter.com/

The wikipedia page for .ico has more information that might help - http://en.wikipedia.org/wiki/ICO_(file_format)

like image 189
Renats Stozkovs Avatar answered Apr 07 '23 12:04

Renats Stozkovs