How to invoke and call an attribute for a static function?
<p>I'm trying to understand the limitations on attributes in C#. I'd like to apply an attribute to a static function like so:</p>

<pre><code>1 public class Simple : System.Attribute
2 {
3    public Simple() { System.Console.WriteLine("Simple ct"); }
4 }
...
5 [Simple]
6 public static void DummyFn()
7 {
8    System.Console.WriteLine("Dummy fn!");
9 }
...
10 DummyFn();
</code></pre>

<p>So, here's what I want to happen:</p>

<ul>
<li>Line 10 invokes DummyFn.</li>
<li>When DummyFn is invoked, the Simple() constructor gets called, which emits the line "Simple ct".</li>
<li>After which DummyFn() gets called, which emits the line "Dummy fn!"</li>
</ul>

<p>As far as I can tell, this doesn't work. If, however, I make DummyFn() non-static, it does work. Can someone help me understand this behavior?</p>
