The .NET Compiler Platform is a collection of open-source APIs for C# and Visual Basic that provides deep code analysis, refactoring, and automated source code generation. It serves as the core infrastructure for building development tools, offering a platform to inspect, modify, and understand source code through immutable syntax trees and semantic models.
The platform distinguishes itself by providing full-fidelity syntax trees that preserve every character of source code, including whitespace and comments, alongside an incremental compilation pipeline that enables near-instant feedback during development. It allows developers to build custom diagnostic analyzers and code fixes that integrate directly into the compilation process, as well as source generators that automatically produce and inject code at build time.
Beyond core compilation, the project includes comprehensive workspace management tools that model entire solutions, projects, and assembly references into a unified hierarchy. This infrastructure supports the development of IDE extensions, static analysis tools, and interactive scripting environments by providing deep semantic querying, symbol identification, and real-time code change tracking.