microsoft / microsoft/aspire

Custom Icons configured via WithIconName do not render in Graph View

Open
#12,100 1 comment 0 reactions 0 assignees View on GitHub
area-dashboard
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

When defining custom icons for resources using the WithIconName extension method in the DistributedApplication.CreateBuilder, the custom icons are correctly displayed in the Table View of the Aspire Dashboard.

However, the same custom icons are not rendered in the Graph View; instead, default icons are displayed for the resources. This results in an inconsistent user experience and prevents effective visual differentiation between resources in the graph.

### Expected Behavior

The custom icons specified using WithIconName should be rendered consistently across all views in the Aspire Dashboard, including both the `Table` view and the `Graph` view.

### Steps To Reproduce

1. Use .NET Aspire project, version **9.5.0**
2. Use the following code:
```
var builder = DistributedApplication.CreateBuilder(args);

var cache = builder.AddRedis("cache")
.WithIconName("Memory", IconVariant.Filled); // Custom Icon: Memory

var apiService = builder.AddProject("apiservice")
.WithHttpHealthCheck("/health");

builder.AddProject("webfrontend")
.WithExternalHttpEndpoints()
.WithHttpHealthCheck("/health")
.WithReference(cache)
.WaitFor(cache)
.WithReference(apiService)
.WaitFor(apiService)
.WithIconName("WebAsset", IconVariant.Regular); // Custom Icon: WebAsset

builder.Build().Run();
```
3. Run the application: Execute the Aspire host project.

Observe the Table View: The custom icons (Memory for cache, WebAsset for webfrontend) are visible in the resource list.

Image

Observe the Graph View: The nodes for cache and webfrontend do not display the configured custom icons.

Image

### Exceptions (if any)

_No response_

### .NET Version info

.NET 9

### Anything else?

Aspire Version: **9.5.0**
OS: **Windows**
Browser: **Chrome 141**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.