AmbiguousMatchException - Type.GetProperty - C# Reflection
<p>Yesterday I ran into an Issue while developing a Web Part (This question is not about webpart but about C#). Little background about the Issue. I have a code that load the WebPart  using the Reflection, In which I got the AmbiguousMatchException. To reproduce it try the below code </p>

<pre><code>        public class TypeA
        {
            public virtual int Height { get; set; }
        }
        public class TypeB : TypeA
        {
            public String Height { get; set; }
        }
        public class Class1 : TypeB
        {

        }

        Assembly oAssemblyCurrent = Assembly.GetExecutingAssembly();
        Type oType2 = oAssemblyCurrent.GetType("AmbigousMatchReflection.Class1");
        PropertyInfo oPropertyInfo2 = oType2.GetProperty("Height");//Throws AmbiguousMatchException 
        oPropertyInfo2 = oType2.GetProperty("Height", 
            BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance);  // I tried this code Neither these BindingFlags or any other didnt help
</code></pre>

<p>I wanted to know the BindingFlag to Fetch the Height Property. You will have the question of why  I wanted to create another Height Property that is already there in the Base class. That is how the <code>Microsoft.SharePoint.WebPartPages.PageViewerWebPart</code> was designed check the Height property of the PageViewerWebPart class.</p>
