views:

127

answers:

5

I know this question has been asked, but I found out that microsoft has recently released the source code for the entire .Net Framework. I was wondering that since now this source is available, if it was possible to download all dependent files from microsoft's code server, and somehow make a native executable that is not needing clr, or jit to run, a bit like a cpp exe.

Thanks

+2  A: 

Simply no. The source code that has been released is for the framework (and not all the framework), not the .NET runtime itself. Therefore the code that you can get from Microsoft still needs .NET to be installed to run and doesn't get you any closer to a native application.

Martin Harris
A: 

Is it not good enough for you to NGEN the executable?

Ries
ngen does not remove the dependency on the CLR
JaredPar
+1  A: 

Are you referring to the for-debug-purposes only distribution of certain framework source files?

These aren't complete (notably, they're missing sections written in native code, and they further comprise only the class library - not the runtime itself).

If you really want this, mono is better starting place - and realize that the clr provides for things like reflection, garbage collection and code generation, so it's not just a matter of "removing it" - you'd be living in a non-compatible subset of .NET at that point.

Eamon Nerbonne
+4  A: 

No it does not for a couple of reasons.

The first problem is that the source is released under the Reference License (Reference).
I'm not a lawyer but my understanding of that license is that it does not allow for redstribution of the content.

Secondly it doesn't add any new and useful data to the equation. A program which essentially combines an executable and all of it's dependencies into a single and independent executable is doing an operation that is very similar to the CPP linker tool. That is combining a binary and all of it's dependencies into a single executable in the absence of source code.

All of the dependency information in .Net assembly can be determined by examining the metadata of an assembly. The source really adds no value here .

The source code for the .Net framework is really only useful if you want to write a new compiler altogether which combines it into one assembly. Even then you would still need a linker style solution to get the CLR into the same executable.

JaredPar
+1  A: 

Take a look at this:

http://www.remotesoft.com/linker/intro.html

Ries