03. January 2022 · Categories: .NET

As a C# programmer, Icon DLLs are a leftover from Windows XP days, but I recently needed to create one. The process is non obvious, but quite simple.

  1. Create a new DLL project for the icons, and remove the default class. To keep things portable, all icons should be in the project folder.

  2. Create a stand alone “Native Resource Template” with File | New | File

  3. Insert a dummy resource, then use File Save As, with the file type “Win32 Resource File”, to move the template to your project folder, and delete the dummy resource again.

    This is needed because the Save As refuses to save a template without any resources

  4. Right click to “Add Resource” and import all your existing icons

  5. In the project properties, tab “Application”, choose Resource file for resources, and select your .res file

  6. Add a reference to your icon and res files into the project to make them easier to open, with build action “None”.