Skip to content

MauiIcons suport .NET8 #77

Closed Answered by AathifMahir
JohnStavrou asked this question in Q&A
Discussion options

You must be logged in to vote

I've implemented the MauiIcons as instructed, but is seems to throw the follwing error:
Cannot resolve type "http://www.aathifmahir.com/dotnet/2022/maui/icons:mi:MauiIcon"
Is it maybe because I am running .net8?

Funny enough if i comment out this part of the code, run the app, and then uncomment, it works fine :P
It is a build issue..

Seems like url namespace issue of Maui is not fixed yet.
dotnet/maui#7503

As a workaround, you can new up the Maui icon instance in code behind.

Here's how you can new up the Maui icons,

In the constructor of mainpage.xaml.cs or app.xaml.cs, you can add discarded instance of Maui icon just like below example

public MainPage()
    {
        InitializeComponent

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@r1di
Comment options

@AathifMahir
Comment options

Answer selected by JohnStavrou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants