-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XamlC error XFC0045 with maui dotnet 9 preview 3 #22318
Comments
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! Closed similar issues:
|
The same error if you use |
Verified this issue with Visual Studio 17.10 Preview 7.0 + NET9.0 SDK (9.0.100-preview.3.24204.13). |
Hi guys, I am facing these issues as well. Is there any workaround settings where we can bypass the error from XamlC similar to cos right now, I can't build and compile the project. kindly advise. |
maui/loc/pl/src/Controls/src/Build.Tasks/ErrorMessages.resx.lcl Lines 69 to 77 in 39f90ee
There's been a few changes in SetPropertiesVisitor since Preview2, and I think this is the only place that throws that exception: https://github.com/dotnet/maui/blame/main/src/Controls/src/Build.Tasks/SetPropertiesVisitor.cs @simonrozsival Would you have any ideas what it could be? |
@rogerbriggen @drasticactions previously, any binding with As a fix, you can set the <CollectionView
x:Name="myCollection"
ItemsSource="{Binding Items}"
...
SelectionChangedCommandParameter="{Binding Source={x:Reference myCollection}, Path=SelectedItem, x:DataType=CollectionView}">
<CollectionView.ItemTemplate>
...
</CollectionView.ItemTemplate>
</CollectionView> Does this solve your problem? |
one thing I found out is that when any parent element has assigned the x Attribute x:DataType with value, those child elements will be overriding with the parent value... basically, it is using the parent context to find the binding hence it throws the Property Binding not found. |
|
@simonrozsival Okay, that makes sense. Should this issue be closed then and duplicated under #21834? |
@drasticactions I'm not sure. I think this is mostly a documentation issue. We've made changes to how XamlC compiles bindings in .NET 9, but we haven't updated the docs yet. I think we need a new issue that will track the necessary changes to documentation and then we can close this issue. |
@cgp1976 Yes, this solves this issue. The only thing which is, that Visual Studio shows an error |
@rogerbriggen I think this is the same warning we saw in #21434. This seems to be a bug in the XAML editor in VS. I wonder where the best place to report it is (cc @StephaneDelcroix @PureWeen). |
@mgoertz-msft Would you know? |
Xamarin and MAUI never cease to surprise me on what they allow that other platforms like WPF and UWP/WinUI don't. I had no idea this was allowed to be used that way. |
I reported the issue in the VS Code extension here: microsoft/vscode-dotnettools#1131 |
This issue is unfortunate and blocks my migration to .NET 9. For context, I don't see an obvious way to do
where |
FYI, the XLS error in the editor has been fixed (see VS Code Issue #1131). @StephaneDelcroix would know most about the XFC error. |
@daltzctr the
If this doesn't solve your problem, please share more of your XAML so we can see more context of the component tree. |
@rogerbriggen I'm closing this issue now since the new behavior has been explained in the thread and we'll cover it in the docs in time for the release of .NET 9 (this is tracked here: dotnet/docs-maui#2187). Please feel free to reopen this issue if something is still unclear. |
@simonrozsival that doesn't work and throws an exception
throws
|
Description
If you use compiled bindings and you use x:Reference Bindings they don't work with dotnet 9 preview 3. It works fine with dotnet 9 preview 2 and dotnet 8.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/rogerbriggen/mauidotnet9pre3_collectionview
Version with bug
9.0.0-preview.3.10457
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
9.0.0-preview.2.10293
Affected platforms
Android, Windows
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: