Closed madcoda9000 closed 9 months ago
The problem with not showing the icons comes from the fact that the ConfigurationGenerator
can not be found.
It looks like source generators/analyzers are not supported on VS Code...If that is indeed true, then I'm afraid you cannot work on your project from a Linux/VS Code machine and you will need to use a Windows/VS machine.
The problem with not showing the icons comes from the fact that the
ConfigurationGenerator
can not be found.It looks like source generators/analyzers are not supported on VS Code...If that is indeed true, then I'm afraid you cannot work on your project from a Linux/VS Code machine and you will need to use a Windows/VS machine.
whoa, that would be a real showstopper at all :-( I'll try to test this on a windows machine.
Thank you for your answer.
so, it seems not to be an linux issue only. I've tested it on windows 11 too.
Yes, that is what I said, a VS Code issue... It works fine with 'normal' Visual Studio.
With v3 we will not be using this generator anymore. Have good hope that VS Code can be used then.
okay, yes you're right :-(
I've done a test in VS2022 and vs2022 can resolve the namespace.
Anyway, the icon is not displaying too :-)
Ok, now we're getting somewhere. It is also not displaying the icon outside of the switch, right? Can you share a repo or get me access to one?
yes, as this is a private repo (https://github.com/madcoda9000/GroupVault). I've added you.
Greetings Sascha
btw. i've tried this approach too.
<FluentSwitch @bind-Value=darkMode @onclick="changeColorMode" style="margin-inline-end: 12px;">
<span slot="checked-message"><FluentIcon Name="@FluentIcons.WeatherMoon" Size="@IconSize.Size16" Variant="@IconVariant.Filled" Color="@Color.Accent" /></span>
<span slot="unchecked-message"><FluentIcon Name="@FluentIcons.WeatherSunny" Size="@IconSize.Size16" Variant="@IconVariant.Filled" Color="@Color.Accent" /></span>
</FluentSwitch>
But it is not working also.
Ok, I managed to get icons to appear, but it was convoluted and I expect it will break at other points. How did I get icons to appear?
Cloned your repo locally. Added FluentUI project and FluentUI.Generator project Added following to project file:
Removed @Attribute [Authorize] from Login.razor (I don't think login page should have authorize at all) Removed @Attribute [Authorize] from Index.razor Start with F5 Navigate to https://localhost:7250/Index
Result:
So there is something in the autorization process/flow that messes up the icon rendering.
As we are on the brink of releasing the v3 version of the library, I won't be spending ore time in investigating/solving this. Upgrading to that version is advised. One of the key things we changed is how Icons/Emoji are handled. See https://preview.fluentui-blazor.net/UpgradeGuide for what you need to change.
Closing this as 'won't fix'
ok, thank you for the information. I understand the upgrade guide and i understand what i have to do. But how can i use v3? In nuget i only can see 2.4.2.
ahh, sorry my fault. I've to check the "include prerelease" checkbox. :-)
I was about to post that...
ps. there is a PR waiting in your repo with upgrade done already...
many thanks. The upgrade was totally smooth. and the Icons are displayed as expected. Many thanks for your help. And please keep up that great work!
Best Regards Sascha
PS: I forgot to mention, now it works with vscode like charm :-)
🐛 Bug Report
💻 Repro or Code Sample
Program.cs
.csproj file
MainLayout.razor
🤔 Expected Behavior
As no error is thrown, i would expect, that the icon is getting rendered.
😯 Current Behavior
VScode is saying that the name ConfigurationGenerator is not known.
But it compiles without errors:
The problem is, that the icon is not displayed. Not even present in the html output!
>
💁 Possible Solution
🔦 Context
so, it would be nice if there is a way to get the icons working.
🌍 Your Environment