Chapter 28. Writing custom attributes

It is recommended that you read and understand Chapter 27 before tackling this chapter.

Custom attributes are attributes which you write and use in your own creative way. However, unlike standard attributes, there is no way you can create custom attributes which can affect how your code compiles (i.e. attributes which are recognizable by the C# compiler) or that may be automatically interpreted by the CLR. Instead, custom attributes are only useful when you use reflection code to interpret and respond to them during runtime.

Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.