How to avoid manual reference to Microsoft.Fast.Components.FluentUI when using Fluent-UI Blazor in a Razor Class Library #391
-
I have encountered an issue where my components wrapped with Fluent-UI Blazor in a Razor Class Library (RCL) do not work when I add the RCL reference to my BlazorApp1 project. Specifically, the components do not work unless I manually add a reference to Microsoft.Fast.Components.FluentUI. I have tried only adding the reference to the RCL project file as shown in the second example below, but it still doesn't work. Example 1 (does work): <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Fast.Components.FluentUI" Version="2.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RazorClassLibrary1\RazorClassLibrary1.csproj" />
</ItemGroup>
</Project>
Example 2 (doesn't work): <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\RazorClassLibrary1\RazorClassLibrary1.csproj" />
</ItemGroup>
</Project>
I do not want to add the reference manually, since I have already added it in the RCL. What am I missing? Any suggestions would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Hi, unfortunately this is not something we can change at the moment. This has to do with the way we currently handle icons/emoji. |
Beta Was this translation helpful? Give feedback.
-
Re icons/emoji, Publish copies static web assets to 'wwwroot' folder, so FileBasedStaticAssetService works fine.
When built and run in debug, icons/emoji are displayed without an issue: |
Beta Was this translation helpful? Give feedback.
I've started with BlazorApp1 (Blazor Server App) and RazorClassLibrary1 (RCL). Added Microsoft.Fast.Components.FluentUI to RazorClassLibrary1 and a simple component with FluentButton. Added componet from RCL to Index page in BlazorApp1.
When i run BlazorApp1, there was no Microsoft.Fast.Components.FluentUI.lib.module.js among the loaded scripts - static web assets of Microsoft.Fast.Components.FluentUI were not loading.
So i commented out the following lines in Microsoft.Fast.Components.FluentUI.csproj (src/Microsoft.Fast.Components.FluentUI/Microsoft.Fast.Components.FluentUI.csproj):