Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET building process and linking

Building is the sequence composed of compiling and linking.

In .NET the source code is compiled into the assembly that contains Common Intermediate Language and type info. At run time the JIT compiler converts the CIL code into native code.

I do not understand, in .NET ,how and when the linking is occurring.

Can someone please explain the process ?

Thanks in advance

like image 937
ProgNet Avatar asked Aug 27 '12 08:08

ProgNet


1 Answers

There's no linking in terms of C++.

I mean, there's no any intermediate "obj"/"lib" files, that can be distributed and linked with another "obj" files later. Reference to an assembly always has dynamic behavior (always dynamic-link library), as opposed to C++ static linking.

Something like linking is a creation of .netmodule. You can build .NET source code with compiler into .netmodule instead of assembly (look here, especially section "Differences Between C# Compiler and C++ Compiler Output"), and later you can link these modules together into a single assembly (see al.exe).

But this is uncommon practice - most of assemblies contains single module, and this work (source -> module -> assembly) has been done by compiler (e.g., csc.exe) behind the scenes. Also, I can't remember any product being redistributed as a set of .netmodule (not as a set of assemblies).

like image 167
Dennis Avatar answered Oct 26 '22 09:10

Dennis