This question is about internals of assembly references.
.Net Core 1.1 Hello world console application assembly (created from dotnet new console
) emits no reference to mscorlib
, only to System.Runtime
and System.Console
, and yet it emits call to [mscorlib]System.Console
.
How is that possible?
.assembly extern System.Runtime
{
.ver 4:1:0:0
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
}
.assembly extern System.Console
{
.ver 4:0:0:0
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
}
.assembly 'console1'
...
.class private auto ansi beforefieldinit Program
extends [System.Runtime]System.Object
...
IL_0006: call void class [mscorlib]System.Console::WriteLine(string)
...