Search code examples
c#compiler-construction

c# compiler: get intermediate output


Is there a way to instruct c# compiler to output source at different stages of compilation: source after syntactic sugar removed, ..., IL.

Perhaps some tools (Resharper?) do this, but I'd like to know how they do that.


Solution

  • No there is not. The C# compiler doesn't produce any intermediate output. It either produces errors / warnings or an assembly.

    Getting the IL can be done with ildasm. This is a tool that ships with .Net that will display the raw IL for assemblies