1. PNG to ICO
  2. Guides
  3. Visual Studio app icon

How to set an application icon in Visual Studio (C# and .NET)

The .exe icon and the window icon are two separate settings. Here is where each one lives.

Updated October 2026

A .NET desktop app shows its icon in two places that are configured separately.

The application icon is baked into the .exe and appears in Explorer, on shortcuts and in the taskbar.

The window icon appears in the title bar, and in WinForms it's set per form.

1. Create the .ico

Visual Studio only accepts .ico files for the application icon. Convert a square PNG of 256×256 px or larger with the PNG to ICO converter, then add the file to your project folder, for example Assets\app.ico.

A multi-size file matters here: Windows picks 16 px for title bars, 32 or 48 px for the desktop and up to 256 px for Explorer's largest views.

2. Set it in Project Properties

  1. In Solution Explorer, select the project, not the solution.
  2. Open Project → Properties.
  3. Go to Application → Win32 Resources.
  4. Under Icon, choose Browse and pick your .ico file.

Rebuild, and the .exe in your output folder carries the new icon.

3. Or edit the .csproj directly

The setting is saved as the ApplicationIcon property. In SDK-style projects you can add it by hand:

<PropertyGroup>
  <ApplicationIcon>Assets\app.ico</ApplicationIcon>
</PropertyGroup>

This is handy in CI builds and when several projects share one icon file.

4. Set the window icon

WinForms

Each form has an Icon property in the Properties window. Pick the same .ico there, or set it in code:

this.Icon = new Icon("Assets\\app.ico");

WPF

Set the Icon attribute on the window. Add the .ico to the project with Build Action set to Resource:

<Window x:Class="MyApp.MainWindow"
        Icon="Assets/app.ico"
        Title="My App" Height="450" Width="800">

5. If the icon doesn't change

  • Explorer still shows the old icon: Windows caches icons. Rename the .exe once, or refresh the icon cache.
  • Icon looks blurry at some sizes: the .ico is missing those sizes. Convert again to get all nine.
  • "Not a valid icon file" style errors: the file is usually a renamed PNG. Convert it instead of renaming it.

Make the .ico for your .NET app

Convert a PNG