-
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
Calling SetBinding after setting a constant value crashes #17776
Comments
it's probably already fixed, I'll write a test to be 100% sure |
Yes it's fixed in the current nightly. Thanks! |
How did you get the nightly build? Could you please point it out? |
I used the steps provided here: https://github.com/dotnet/installer/blob/main/README.md In my case I used the alternative NuGet package source and updated to the latest nightly build in package manager. Make sure to check "Include prerelease". One culprit though: The RC1 build are listet at the top of the list. You have to scroll a bit to find the nightly builds. I didn't see that at first. There are a lot of builds. |
Description
If I set a binding on a control in code behind after a constant value has been set, the application crashes with an ArgumentException: An item with the same key has already been added. Key: Microsoft.Maui.Controls.SetterSpecificity (Parameter 'key')
This is new behavior in .NET 8 as I cannot reproduce this with .NET 7. We use this heavily in our quite large application with many user controls and for us it is almost a blocker for migration to .NET 8. There might be a workaround but it's difficult to spot all the instances this is happening. We are really looking forward to 8 as we are dealing with a lot of bugs in 7 that are really slowing us down.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.92
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
All
Did you find any workaround?
No. Even clearing the binding or setting the property to null doesn't help.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: