title: Attribute argument must be a constant error when using an optional parameter in the attribute constructor
body: <p>Can anyone explain why this code works:</p>
  
  <pre><code>public class AdministratorSettingValidationAttribute : Attribute
  {
      public AdministratorSettingValidationAttribute(AdministratorSettingDataType administratorSettingDataType)
      {
          DataType = administratorSettingDataType;
      }
  
      public AdministratorSettingValidationAttribute(AdministratorSettingDataType administratorSettingDataType, Type enumerationType)
      {
          DataType = administratorSettingDataType;
          EnumerationType = enumerationType;
      }
  }
  </code></pre>
  
  <p>...but refactoring it to use an optional parameter instead:</p>
  
  <pre><code>    public AdministratorSettingValidationAttribute(AdministratorSettingDataType administratorSettingDataType, Type enumerationType = null)
      {
          DataType = administratorSettingDataType;
          EnumerationType = enumerationType;
      }
  </code></pre>
  
  <p>...causes a compile time error: 
  "<strong>An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type</strong>".</p>