Relative Content

Tag Archive for c#androidxamlmauiargumentexception

.Net Maui ArgumentException: ‘An item with the same key has already been added. Key: Microsoft.Maui.Controls.BindableProperty’ – What does that mean?

I’m really at a loss here.
I’m working on a .Net Maui Application for Android and iOS for work. When I open a specific page I sometimes (like, maybe 1 out of 6-10 times) get an Error with this message: “System.ArgumentException: ‘An item with the same key has already been added. Key: Microsoft.Maui.Controls.BindableProperty'”. No further information… The call stack in VS shows nothing except [External Code] when Debugging (gee, very helpful…). I’ve tried it both on my physical device and with the Standard Pixel 5 – API 34 Emulator.
I’ve wrapped every bit of code, that I suspect of being the culprit in try/catch statements. None of them seem to catch the exception. I’ve also tried to see if I can isolate the problem by observing the parallel stacks. Nothing gives me any usable information, where or what triggers the problem.