fix: PublishFluentIconAssets not working in the v2.1 nuget package
See original GitHub issueš Bug Report
v2.1 of the nuget package are missing icons. Using the readme to include them throws an exception.
I tried to add it to my existing project but when using the datagrid that needs icons for the sort and filter indicator, it throws the following exception:
Unhandled exception rendering component: The requested icon (ArrowSortUp, Size20, Regular) is not available in the collection System.ArgumentException: The requested icon (ArrowSortUp, Size20, Regular) is not available in the collection at Microsoft.Fast.Components.FluentUI.FluentIcon.OnInitialized() in /_/src/Microsoft.Fast.Components.FluentUI/Components/Icon/FluentIcon.cs:line 95 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Seems the icons are not loaded. I tried to follow the latest whatās new readme by adding the following to the project file:
<PublishFluentIconAssets>true</PublishFluentIconAssets>
<PublishFluentEmojiAssets>true</PublishFluentEmojiAssets>
But it still didnāt work
I also create a new blazor server app using the provided templates and added <PublishFluentIconAssets>true</PublishFluentIconAssets> along with the runtime check in program.cs eg:
LibraryConfiguration config = new(ConfigurationGenerator.GetIconConfiguration(), ConfigurationGenerator.GetEmojiConfiguration());
builder.Services.AddFluentUIComponents(config);
but it threw the exception below:
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.Fast.Components.FluentUI.Infrastructure.IStaticAssetService Lifetime: Scoped ImplementationType: Microsoft.Fast.Components.FluentUI.HttpBasedStaticAssetService': Unable to resolve service for type 'System.Net.Http.HttpClient' while attempting to activate 'Microsoft.Fast.Components.FluentUI.HttpBasedStaticAssetService'.)'
Issue Analytics
- State:
- Created 7 months ago
- Comments:8

Top Related StackOverflow Question
Thanks a lot! Will check it tomorrow
Thanks that worked.
But the datagrid only shows the up arrow when sorting in any direction. The demo site has the same behaviour