title: Can Attributes on a Property be Hidden?
body: <p>I am attempting to use reflection to determine which Properties of a Type have a certain Attribute.  This seems to work fine when I create a custom attribute myself, but is currently not working for an attribute in a 3rd party assembly.</p>
  
  <p>The assembly in question is SolrNet, and the Attribute is of Type <code>SolrField</code>.</p>
  
  <p>Example class with usage:</p>
  
  <pre><code>public class PublicDocument : SearchItem {
  
      [SolrField("case")]
      public string CaseNumber { get; set; }
  
      [SolrField("case_name")]
      public string CaseName { get; set; }
  }
  </code></pre>
  
  <p>Here is my code for getting at these Attributes.  The curious thing is that the property.Attributes is empty!  <strong>EDIT</strong>: After looking again, this property will be empty even with other custom types and seems to be reserved for framework Attributes.</p>
  
  <pre><code>        PublicDocument item = new PublicDocument();
          foreach (PropertyInfo property in item.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) {
  
              foreach (object attribute in property.GetCustomAttributes(typeof(SolrField), true)) {
                  //do some stuff here
              }
          }
  </code></pre>
  
  <p>SolrField is defined here: <a href="https://github.com/mausch/SolrNet/blob/master/SolrNet/Attributes/SolrFieldAttribute.cs" rel="nofollow">https://github.com/mausch/SolrNet/blob/master/SolrNet/Attributes/SolrFieldAttribute.cs</a></p>
  
  <p>As I said, this same code works fine with an attribute defined in one of my own assemblies and used in the same pattern.  So my question here is, can Attributes be marked to not show up through reflection like this, or is there another issue here?</p>