Take the 2-minute tour ×

I'll be completely honest, one reason I love C# and .NET is that it has for ALL of my development career abstracted me from the well crafted under the hood stuff, I believe as a .NET developer I shouldn't need to know much about.

This might seem like blasphemy for me to say I really do not care much about CLR, CIL, JIT, or MSIL and all the other internal technologies which up until now to be completely honest are more or less acronyms that mean very little to every day problems I find myself facing as a .NET developer, and solving with the bread and butter of .NET.

My experience is varied like most of you guys with 2 years + experience. I've been using .NET since it was launched, and even back in the days when ASP.NET was called ASP+.

I have yet to come across a situation where knowing how .NET does what it does provides me any practical value. I also fully believe that the authors of .NET very carefully planned .NET to provide this fantastic level of abstraction from specific hardware and OS version for this reason - simply put write your code and get on with your job!

Long story short: Going for an interview next week, and I'm sure these theoretical questions will come up, and so I would like to put in about 4-5 hours to study the internals so I can (with confidence) satisfy an interview test.

Is there a good book or site which details all the .NET internals in a way that is easy to understand?

EDIT: To clear things up a bit, when I refer to .net internals - what I mean is not reflecting and inspecting framework code, mainly knowing how .net code from writing it ends up as executable byte code.

share|improve this question
Good luck with that 4-5 hours, let me know how that works out. –  Brandon Moretz Nov 3 '11 at 22:05
You're screwed. –  kirk.burleson Nov 4 '11 at 0:09
There was a book about IL assembler, but I don't know if it was updated after version 1.0 of .NET, which is of course ancient. It's probably a 4-5 months thing rather than 4-5 hours, as well, and it's probably not a practical "under the hood" view anyway - too much unimportant detail getting in the way. –  Steve314 Nov 4 '11 at 13:00
add comment

7 Answers

CLR via C# by Jeffrey Richter (Amazon link)

Unless you're a heavy practioneer of speed reading, you're not gonna get through it in 4-5 hours. But it has some pretty good introductory chapters at the start of the book, which helps you to see the big picture of the things 'under the hood'.

The book is really packed with information, but it's not dry or formal to read. It's written in a more conversational format, which makes it easier to read.

share|improve this answer
add comment

You will not learn theory or internals in 5 hours. You will just learn what those terms mean in the high level overview and that should be enough for common interview. To learn the meaning you can simply use MSDN or Wikipedia.

share|improve this answer
add comment

This blog from Eric Lippert, one of the key person is .net development team in microsoft is very useful to know about .net internals-


You can also find him in Stackoverflow and Programmers.SE and know many things from his answers of various questions.

share|improve this answer
Agreed. Read the entire blog starting at around 2005/2006, and you'll have some glimpse of an insight into what .Net is like from the inside. –  configurator Nov 4 '11 at 11:48
add comment

I'm not a .NET guy, but I don't think Microsoft wants you to know their internals. Mono, however, is open source and I'm sure they have documentation that outlines how everything works.

A lot of stuff in .NET isn't specific to .NET - JIT among other things can (and should) be learned about independent from .NET. Wikipedia can get you started.

share|improve this answer
Not entirely true. You can also download the source code (referencesource.microsoft.com) for a lot of the .NET assemblies Microsoft has made. Also, it's not a secret how the different layers in .NET work. It's an open specification. That's why Mono and other implementations of .NET can even exist. –  René Nov 3 '11 at 22:23
Ecma-335 contains enough of the information on the internals (not quite up to date, but still mostly applicable). –  SK-logic Nov 4 '11 at 8:11
If Microsoft didn't want you to know their internals, they wouldn't have made it open source... en.wikipedia.org/wiki/… –  configurator Nov 4 '11 at 11:46
Microsoft are happy for you to know their internals. But lawyers will be all over you if you copy their internals. –  MarkJ Nov 4 '11 at 12:13
@MarkJ - To me, what you say seems to imply a vendor-lock-in thing - if you know the internals and write code depending on them, it's harder to convert to other platforms/languages/whatever later. Yet it's often very easy to move from Microsoft .NET to non-Microsoft Mono, and Microsoft seemed to encourage the development of third-party implementations of .NET and C# from the start. Are you just referring to copyright issues? Or are you hinting at something else? –  Steve314 Nov 4 '11 at 13:12
show 1 more comment

The best way to learn more about the internals is to first learn a language that is hard on the metal like C++ or so, find out how different language aspects relate to hardware (for example vmalloc/kmalloc and DMA). Then read something about garbage collecting. uh, what?.. time is up?

Alternatively, you could view this presentation and read some more interviews ith Anders. You should be able to pick up some keywords there you can repeat during the interview.

share|improve this answer
add comment

It is going to be hard to get all the details in 5 hours, but still possible if you already know at least some basics of the compilers theory. In this case, reading through System.Reflection.Emit.OpCodes docs will give you enough of the .NET entrails information.

Most of the .NET languages are compiled in the most straightforward, ad hoc manner, so it would not be that difficult to figure out how specific entities of your programming language are mapped into the bytecode. The only tricky exception is C++/CLI, which is a real optimising compiler - you'll easily find loop unrolling and loop invariant extraction in the generated bytecode. But I am not sure you really need to understand this stuff, unless you want to implement your own optimising compiler.

And, I do not believe that knowing how to compile .NET languages is irrelevant for the day to day programming practice. Being able to implement your domain-specific languages will significantly increase your productivity. I cannot imagine a single real world problem which would not benefit from a DSL-based implementation. Even the boring, mundane CRUD stuff produced an enormous amount of DSLs (e.g., all the ORMs are originating there).

So it would make sense for you to go into that depths, for the sake of your own efficiency, not just for the interview.

share|improve this answer
add comment

What I do these days is, find top voted answers in Stackoverflow for a particular topics in .Net using tags and read them. Community gives very good explanation of "under the hood" facts.

Not to forget MSDN links.

share|improve this answer
add comment

Your Answer


