title: How can I determine property types using reflection?
body: <p>How would I test a property of a type to see if it is a specified type?</p>
  
  <p>EDIT: My goal is to examine an assembly to see if any of the types in that assembly contain  properties that are MyType (or inherited from MyType).</p>
  
  <p>Here is the track I've gone down...</p>
  
  <pre><code>AssemblyName n = new AssemblyName();
  n.CodeBase = "file://" + dllName;
  Assembly a = AppDomain.CurrentDomain.Load(n);
  
  foreach (Type t in a.GetTypes())
      foreach (PropertyInfo pi in t.GetProperties())
          if ( pi.PropertyType is MyType ) // warning CS0184
              Console.WriteLine("Found a property that is MyType");
  </code></pre>
  
  <p>This compiles with warning CS0184: The given expression is never of the provided ('MyType') type</p>