System.Reflection.AmbiguousMatchException from xaml in Windows Phone

Wednesday, September 3, 2014

Lately I ran into a tricky bug inside a Windows Phone application. Sometimes an unhandled exception was thrown that caused the application to crash. Looking into the logs showed that the exception was System.Reflection.AmbiguousMatchException which is caused when the reflection mechanism finds more than one option for a member in a class. TL;DR; – Don't bind in xaml to a property with new modifer  The reason for the exception was that one of the team members decided to derive a class from some entity - lets call the entity Person. public class Person { public int Age...