If this has not been done, there is only one reason for this: attempts to do this are above the potential benefits.
Microsoft certainly will not do this because the costs are too high: the .net code lives in assemblies and no one will change it. And yes, assemblies prevent phased compilation by class. No one will stop using assemblies.
And here is my answer, why no one needs this. You can distribute your classes that make up a single project between several assemblies and compose them one by one. This is actually an incremental compilation, but not as fine-grained as a phased class compilation. And when your architecture is properly designed, incremental compilation of the assembly level is required.
Edit : Well, I downloaded the Mono C # compiler to see what can be done to make it incremental. I think this is not very difficult. Basically, it performs the following steps: 1) parsing files 2) compilation 3) assembly. You can get caught somewhere after compiling the types and saving as intermediate files. Then recompile only the changed ones. So it's possible, but it seems that for the Mono team this is not a priority.
Change 2 . I found this interesting thread where people discuss incremental compilation for the Mono C # compiler. It is quite old, but a key explanation may remain relevant:
Lexing and parsing is usually very fast and depends only on the size of the analyzed code. semantic analysis is usually the right time step when loading assemblies and sifting around a huge metadata for resolving characters and types it’s actually the meat of the compiler. In addition, the new “compiled” code is “attached” to this metadata / AST, which increases complexity solving characters over time. The radiation code is first made in memory, so it's fast. Saving to disk is slow, but depends on the emitted code.
For incremental compilation, metadata caching will do everything very quickly, since usually very little would be changed from one compilation to others. But gmcs will only have to invalidate the part of the metadata / AST that it was not built for .
Edit 3 : The C # compiler had the /incremental option in versions 1.0 and v1.1, but it was removed :
The / incremental flag found in the C # 1.0 and 1.1 compiler versions is now deprecated.
Edit 4 : Miguel de Icaza gives a clear answer ( 1 , 2 ) why the Mono Compiler will not be incremental:
There are many, many other places where GMCS is simply not designed to run a script to edit and continue.
If someone wants to make this the topic of abstracts, this is fine with me, but the number of changes is also large in too many areas. I don’t even want to list them.
The reason I didn't list things is because they will be everywhere in the compiler. I am sure that you will encounter them as soon as you try them; -)
Therefore, he believes that this task is more difficult than for one person. And Mono has much more outstanding and relevant tasks.