It's a known bug. The .NET GDI doesn't even have an icon encoder so it saves it as a png file. I was trying to find a solution for that for a long time and the only thing I've found is that you can use a free image conversion library called FreeImage (
http://freeimage.sourceforge.net/ ) which can save images to many different icons. It's free and released under the GNU license if I'm not mistaken, but there's one limit - it can save icons only in this size
range: 16x16 - 128x128 . So keep in mind that smaller or bigger images won't be saved.

If you find a better solution please share it with us. I'd really like to know how to solve it without using an external source.

Thanks but I don't think I know how to use it in order to create the icon. An icon file's layout is quite complicated, as explained in this article:
http://www.codeproject.com/dotnet/MultiIcon.asp . I think that if you need to convert a bitmap to an icon you'll first have to get a lot of information from that bitmap and that's the hard part.
But maybe there's something I don't know about.

Jorgie, by just changing the file extension, Windows Explorer seems to recognize it. But when it is used as a Windows Form icon, VS2005 throws an error, "Argument 'picture' must be a picture that can be used as a Icon".

After some reading, it appears that to correctly do it, I have to manupulate Bitmap headers and Icon headers / structs myself based on Windows API documentation; and there will be quite some coding. That is rather odd to me since it is a known problem; nonetheless
.NET 2.0 chooses not to address it.

Thanks guys for the replies. I will attemp to do some coding and it is surely going to be an interesting experience.

Great - don't forget to tell us if you find out how to do it right. I'm also interested in this. BTW, maybe this can help you:
http://www.codeproject.com/dotnet/safeicon.asp - it shows a code that can convert an Image object to an icon but it doesn't work with all sorts of icons.

Great - don't forget to tell us if you find out how to do it right. I'm also interested in this. BTW, maybe this can help you:
http://www.codeproject.com/dotnet/safeicon.asp - it shows a code that can convert an Image object to an icon but it doesn't work with all sorts of icons.

the .NET framework's class libraries have only been extended in .NET 3.0 and 3.5, all the core assemblies remain the same. So no.

Re: Jorgie: that wouldn't work because an ICO is application/x-icon, Explorer is just more tolerant and loads up the Win32 bitmap reader despite the file extension, a proper icon reader would choke on it.