Roslyn Compiler Extensions
Roslyn compiler extensions offer a powerful way to modify and extend the behavior of the C# compiler. With the Roslyn compiler, developers can write code that analyzes and modifies C# code at compile-time, opening new possibilities for code generation, code transformation, and optimization.
In this chapter, we will explore the technical setup of a Roslyn compiler extension project. The chapter itself is not focused on metaprogramming, but rather, on the technical setup for the two following chapters. We’ll delve into the process of packaging a Roslyn compiler extension for reuse. We’ll explore the different packaging options available, such as NuGet packages, and discuss best practices for making your extension easy to consume by other developers.
We will cover the following topics in this chapter:
- How to set up a project and its moving parts
- How to package your extension for reuse
By the end of this chapter, you will...