Groups | Blog | Home
all groups > dotnet general > september 2003 >

dotnet general : Attributes (intrinsic/pre-defined/standard)


Jim Trela
9/28/2003 7:30:38 PM
How can I find out the names of all the attributes that
are intrinsic (pre-defined, or standard) in the .NET
framework ? I saw in a presentation that there are
supposedly around 178 pre-defined ones. I know that it is
possible to define your own, but I want to know what the
standard ones are, besides [Webmethod] and [Serializable].
I did try searching the the help alphabetically ([a*],
[b*], ...), but my query was not limited to the results I
expected.

Also, since the interface "ISerializable" is also
implemented as an attribute ([Serializable] ?), is EVERY
interface implemented as an attribute ? Conversely, does
every attribute have a counterpart that is an interface ?
For instance, I don't believe that "[Webmethod]" has a
corresponding interface named something like "IWebmethod".
Eric Gunnerson [MS]
9/29/2003 2:18:59 PM
I don't know of any list that shows all the attributes. You could write
something that would iterate over all the classes in all the assemblies and
list those that derive from System.Assembly.

[Serializable] is the attribute used to indicate that a class can be
serialized. ISerializable is used to provide customer serialization for a
class. They're related, but not the same thing.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view]

Mattias Sjögren
9/29/2003 5:12:05 PM
Jim,

[quoted text, click to view]

See

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemattributeclasshierarchy.asp

Or open up Wincv.exe and type in "Attribute".



[quoted text, click to view]

No


[quoted text, click to view]

No



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
AddThis Social Bookmark Button