views:

326

answers:

3

how c# compiler works??

how it parses our whole solutions and .cs files... i want to know where it start and how everything works... i want to know from the asp.net perspective...

thx

+5  A: 

If you're really interested in how a C# compiler works, you may want to read the source code from Mono's compiler, mcs.

anthony
This is actually quite interesting.
Callum Rogers
+1  A: 

A really brief explanation could be:

  • In Asp.net, you write an page.aspx file that get compiled into a .Net assembly, this assembly is then used by the Asp.Net runtime that execute http request.
  • This .Net assembly can be written in any .Net language like c# or VB.Net. But in the end, the code is compiled by the .Net CLR compiler into a Common Intermediary Language(CIL). This CIL is used by the CLR runtime which get loaded when you start a .Net process. The JIT then use this CIL and transform it into pure assembly that will be understandable by the computer.
SelflessCoder
+2  A: 

Eric Lippert gave a great synopsis of the C# compiler in this answer.

Sapph