How to Create a Favicon in Visual Studio 2005 ASP.NET Web Project

In Internet Explorer 7 the new tabs feature shows the sites icon, aka favicon.ico. (I know tabs has been around in Firefox and other browsers forever but I’ve been stuck with IE)

I’ve been lazy and haven’t created favicons for my sites, but after using IE7 for a few days I realized that they’re pretty great when you have many tabs open.
So I Googled a little and found out that the favicon.ico file cannot be just any image file, it has to be a 16×16 pixel .ico file (at least if you want it to work in IE, some other browsers support all kinds of images incl animated gifs) and that not that many imaging programs can create .ico files out of the box, but Visual Studio can.

The only problem is that in Visual Studio 2005 for a web project (ASP.NET) you cannot add an item that is of type icon 🙁

So after some testing and searching I discovered these two workarounds to create a favicon.ico for a web project:

1) Easiest: Use an existing .ico file and just add it to your project. Double-click it and the icon editor fires up.

2) Easy but not as easy: Create a Windows Application project. From here you can create an item of type icon.

If you got a better solution please let me know.

Just make sure your 16×16 pixel favicon.ico is in the root of your web app and it should work. You should also add a LINK tag in the HEAD section of your html: (but this doesn’t seem to be necessary)

<link rel=”SHORTCUT ICON” href=”favicon.ico”>

There is plenty of info available on Google on how to implement favicons, this is one good link.

I had to clear my IE7 history to get my favicon to show up and I did read about other people who also had to clear their caches etc.

Published
Categorized as ASP.NET

3 comments

Leave a comment

Your email address will not be published. Required fields are marked *