title: Why do properties of attributes have to be readable?
body: <p>Consider the following attribute.</p>
  
  <pre><code>internal class NiceAttribute : Attribute
  {
    private string _stuff;
  
    public string Stuff
    {
      set { _stuff = value; }
    }
  }
  </code></pre>
  
  <p>When I try to use the attribute <code>[Nice(Stuff = "test")]</code> the compiler gives the following error.</p>
  
  <blockquote>
    <p>'Stuff' is not a valid named attribute argument. Named attribute
    arguments must be fields which are not readonly, static, or const, or
    <strong>read-write</strong> properties which are public and not static.</p>
  </blockquote>
  
  <p>What is the rational behind the requirement for the property to be <em>readable</em>?</p>
  
  <hr>
  
  <p><strong>Update</strong><br>
  I will try to sketch my use case for having write-only properties on attributes.</p>
  
  <pre><code>interface ISettingsBuilder
  {
    Settings GetSettings();
  }
  
  class SettingsAttribute : Attribute, ISettingsBuilder
  {
    private readonly IDictionary&lt;string, object&gt; _settings =
      new Dictionary&lt;string, object&gt;();
  
    public Settings GetSettings()
    {
      // Use _settings to create an immutable instance of Settings
    }
  
    public string Stuff
    {
      set { _settings["Stuff"] = value; }
    }
  
    // More properties ...
  }
  </code></pre>
  
  <p>There may be other implementations of <code>ISettingsBuilder</code>. For example one that offers a nice API to build settings through code.</p>
  
  <p>I ended up with implementing my getters by throwing a <code>NotImplementedException</code>.</p>
  
  <pre><code>  public string Stuff
    {
      get { throw new NotImplementedException(); }
      set { _settings["Stuff"] = value; }
    }
  </code></pre>
  
  <p>Can you think of a nicer way to do something like this?</p>