CommunityToolkit/Maui.Markup

[BUG] Label' does not contain a definition for 'TextCenter'

Closed this issue · 5 comments

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

Build fails with 66 errors. Here's one of them:

Label' does not contain a definition for 'TextCenter' and no accessible extension method 'TextCenter' accepting a first argument of type 'Label' could be found maui

Solution is to downgrade the CommunityToolkit.Maui.Markup NuGet package to 3.2.0.

Expected Behavior

Sample application should start after building the solution project.

Steps To Reproduce

  1. Open Sample solution.
  2. Build.

Link to public reproduction project repository

Huh?

Environment

- .NET MAUI CommunityToolkit:
- OS:
- .NET MAUI:

Anything else?

No response

I've experienced this bug too, but haven't figured out the fix yet.

In my experience, it happens on macOS but not on Windows.

However, it works in our CI builds. This leads me to assume it's a local environment configuration problem.

I'll keep poking at it to see if I can figure out the culprit.

In the meantime, check out our CI Pipeline environment configuration to see how to best configure your local environment: https://github.com/CommunityToolkit/Maui.Markup/blob/main/azure-pipelines.yml

Workaround

An easy work-around is to downgrade to CommunityToolkit.Maui.Markup v3.2.0. The only new feature added to v3.3.0 is .NET Hot Reload support.

Indeed, this occurred on a macOS Sonoma.

Hey @iamalexmang! Are you still seeing this error?

I'm not longer experiencing it on my machine after the GA release of .NET 8.

Nope, not anymore. Though I'm not sure if this is thanks to .NET 8 or not, I can confirm the error went away.

Thanks for confirming!

We can reopen this if/when another member of the community reports it again.