Making Native.Net exectuables?

Now that Microsoft has released the .Net Framework sources, I am surprised:

Can we somehow compile the .Net code to a native executable that doesn't require clr or jit to run?

+2


source to share


5 answers


No, this is not for several reasons.

The first problem is that the source is released under a reference license ( Link ).
 I am not a lawyer, but my understanding of this license is that it does not allow redstribution of content.

Second, it doesn't add any new and useful data to the equation. A program that essentially combines an executable file and all of its dependencies into a single and separate executable does an operation that is very similar to the CPP linker tool. It is the concatenation of a binary and all of its dependencies into one executable file without source code.



All dependency information in a .Net assembly can be determined by examining the assembly metadata. The source doesn't really add any value here.

The source code for the .Net framework is really useful if you want to write a completely new compiler that bundles it into one assembly. Even then, you still need a linker solution to get the CLR into the same executable.

+4


source


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



+2


source


Do you mean only distributing source files for debug purposes?

They are not complete (in particular, they do not contain sections written in their own code, and they only contain the class library, not the runtime itself).

If you really want to, mono is the best place to start - and understand that clr provides things like reflection, garbage collection, and code generation, so it's not just a matter of "deleting" - you will be living in an incompatible subset of .NET at this point ...

+1


source


+1


source


Isn't that enough for you to make the NGEN executable?

0


source







All Articles