views:

125

answers:

3

Quite simple question, and I really wanna know the reason (the real reason) behind this. Say you want to distibute a .NET app to computers without .NET installed (not even 1.1). Why can't we just include mscorelib.dll & others with out app? Is it because CLR must be installed in some way, to gain JIT capabilities for intepreting IL?

I know this is quite meaningless question nowadays since every system has a minimum of .NET 2.0, but I still wonder :=)

+5  A: 

Well, as you already said, the assemblies alone are useless.

You need the runtime environment, including the jitter, type loader, garbage collector etc.

Maximilian Mayerl
+3  A: 

.NET is a Just In Time interpretted langauge. Your assemblies don't compile down to a binary executable.

Therefore you need to have the .NET runtime installed so your code can be interpreted at runtime. Without it...your app isn't going to be doing much of anything.

Justin Niessner
+1  A: 

Installing the libraries and the CLR also allows for shared assemblies. Do you really want hundreds of copies of the CLR running loose on your machine? I like the fact that I know certain things will be available for my application. Much better than having to worry about… Did I compile for 1.4.5 or 1.4.6 version of the runtime... maybe it was even 1.2.5 (JRE can be a pain)

Also there are many parts of the .Net Framework that are just managed wrappers over unmanaged APIs. As well as tons of other assemblies that you use but are not directly referenced. (see mscoree.tlb and many others)

Matthew Whited
Yeah, I think you are right about that ...
Sapphire