Wes,
Consider the following:
public class MyAttribute<T> : Attribute
{
}
[MyAttribute<MyClass>]
public MyClass
{
}
The compiler wouldn't know what to do, as it would have to have a type
definition for MyClass to create the metadata for MyClass, but the MyClass
type definition isn't complete without MyAttribute<T> being resolved.
You could use a compiler check to make sure that this case wasn't
applied, but I think it is a good idea that they didn't allow this for now.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Wes" <ne********@puzzleware.net> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
Why can't you create a Generic type that inherits from Attribute? Of
course I'm talking about in C# 2.0 and .Net Framework 2.0.
I posted this question on my weblog
(http://weblogs.asp.net/whaggard/arch...12/241476.aspx) last week
but I no one gave an answer. So I figured I would post it to the C#
newsgroup to see if anyone can shine some light on this question for me.
Thanks
Wes Haggard
http://weblogs.asp.net/whaggard/