Handling Metadata in C#

In the previous chapter, we started discussing metadata, the information a module can store about its types, code, methods, and so on. In this chapter, we're going to continue discussing metadata as we turn to attributes and reflection.

As we've seen throughout the book, attributes let you specify metadata, including directives to the compiler, in your code. You can read this metadata yourself with tools like ILDASM and others, and you can also access it in code, as we're going to see. Reflection, introduced in this chapter, is a set of techniques that allows an application to read and work with its own metadata. Custom attributes of the kind we'll see in this chapter can be very useful in the reflection process. One reflection ...

Get Microsoft® Visual C#® .NET 2003 Kick Start now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.