title: why can't I load the AssemblyVersion attribute using reflection?
body: <p>The assemblyinfo.cs file has the AssemblyVersion attribute, but when I run the following:</p>
  
  <pre><code>Attribute[] y = Assembly.GetExecutingAssembly().GetCustomAttributes();
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>System.Runtime.InteropServices.ComVisibleAttribute
  System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
  System.Runtime.CompilerServices.CompilationRelaxationsAttribute
  System.Runtime.InteropServices.GuidAttribute
  
  System.Diagnostics.DebuggableAttribute
  
  System.Reflection.AssemblyTrademarkAttribute
  System.Reflection.AssemblyCopyrightAttribute
  System.Reflection.AssemblyCompanyAttribute
  System.Reflection.AssemblyConfigurationAttribute
  System.Reflection.AssemblyFileVersionAttribute
  System.Reflection.AssemblyProductAttribute
  System.Reflection.AssemblyDescriptionAttribute
  </code></pre>
  
  <p>and yet I have checked countless times that this attribute is present in my code:</p>
  
  <pre><code> [assembly: AssemblyVersion("5.5.5.5")]
  </code></pre>
  
  <p>...and if I try to access it directly I get an exception:</p>
  
  <pre><code>Attribute x = Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyVersionAttribute)); //exception
  </code></pre>
  
  <p>I guess I won't be able to use that attribute, but how come .NET isn't reading it?</p>