CommunityToolkit/Maui

[BUG] Typed bindings cause exception

owl-guy opened 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

When entering a page with typed bindings, we get the following error message:
Image

Expected Behavior

The bindings should resolve without problem

Steps To Reproduce

  1. Create a new .NET MAUI App with .NET 9
  2. Add a typed binding to the MainPage
  3. Start the app and navigate to the MainPage
  4. The app crashes

Link to public reproduction project repository

https://github.com/owl-guy/TypedBindingExample

Environment

- .NET MAUI CommunityToolkit: 9.1.1
- OS: Android
- .NET MAUI: 9.0.0

Anything else?

No response

@owl-guy getting a 404 for your link

@owl-guy getting a 404 for your link

My bad, i accidentally made the repo private. Should work now

One obvious issue I can see with the sample is that it doesn't call the UseMauiCommunityToolkitMarkup method. You can find how to use it in the docs:

https://learn.microsoft.com/dotnet/communitytoolkit/maui/get-started?tabs=CommunityToolkitMauiMarkup

Also the markup code is held in a different repo. Once I'm on my laptop I'll see if I can transfer this issue to the other repo

Please wait until we release support for .NET 9.

MAUI completely reengineered compiled bindings in NET 9 and our NuGet package is not yet compatible until we release CommunityToolkit.Maui.Markup v5.0.0.