Retargetable assembly references have been introduced for the .NET Compact Framework and are now used to support Portable Class Libraries.
Basically, the compiler emits the following MSIL:
.assembly extern retargetable mscorlib
{
.publickeytoken = (7C EC 85 D7 BE A7 79 8E )
.ver 2:0:5:0
}
How does the C# compiler understand it has to emit a retargetable reference, and how to force the C# compiler to emit such reference even outside of a portable class library?
For the assembly itself, it’s an assembly flag, ie [assembly: AssemblyFlags(AssemblyNameFlags.Retargetable)].
Make note that this flag is meaningless outside of platform assemblies – custom assemblies cannot be retargetable.
For references, it’s copied as part of the name from the assembly being referenced.