Does .NET have a linker?

From the Jon Skeet Blog:

What does the following comment mean?

// The line below only works when linked rather than // referenced, as otherwise you need a cast. // The compiler treats it as if it both takes and // returns a dynamic value. string value = com.MakeMeDynamic(10); 

I understand what the assembly reference is. You can refer to it when compiling program files using / ref: switch on the command line or you can add a static assembly reference in Visual Studio.

But how do you reference the assembly in .NET? Does he mean load the assembly using Reflection (Assembly.LoadFile ())? Or Win32 API LoadLibrary ()? Or does .NET have a linker that I've never heard of?

+6
c # clr com-interop
source share
1 answer

This is for COM Primary Interop Assemblies, basically. In .NET 4, you can either refer to them as normal or "link" / "embed", in which case you will only get the parts of the PIA that you are interested in, built into your own assembly.

From the command line, this is the /link: C # 4 compiler option.

+10
source share

All Articles