6

Observing and Modifying Code Execution Dynamically

This chapter is about some common types that are included with .NET for performing code reflection and applying and reading attributes, working with expression trees, and creating source generators.

This chapter covers the following topics:

  • Working with reflection and attributes
  • Working with expression trees
  • Creating source generators

Working with reflection and attributes

Reflection is a programming feature that allows code to understand and manipulate itself. An assembly is made up of up to four parts:

  • Assembly metadata and manifest: Name, assembly, file version, referenced assemblies, and so on.
  • Type metadata: Information about the types, their members, and so on.
  • IL code: Implementation ...

Get Apps and Services with .NET 7 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.