Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core - System.Private.CoreLib.dll vs System.Runtime

In a .NET Core App, if I do

typeof(DateTime).Assembly.Location

I get

C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.4\System.Private.CoreLib.dll

But the documentation for the DateTime struct says the assembly is System.Runtime.dll

I am trying to locate the XML Documentation file for DateTime. I cannot locate a System.Private.CoreLib.xml on my system but a System.Runtime.xml does accompany the System.Runtime.dll file in its folder (per XML documentation convention).

How does System.Private.CoreLib.dll relate to System.Runtime.dll ?

I am trying to use Roslyn to grab the XML <Summary> tag content, (similar to a hover tooltip in Visual Studio) but I cant see how to associate a Type with the location of the XML documentation ?

like image 781
OrdinaryOrange Avatar asked Dec 05 '25 20:12

OrdinaryOrange


1 Answers

How does System.Private.CoreLib.dll relate to System.Runtime.dll ?

System.Runtime.dll is a so-called Reference assembly, which means it's only containing the public API without implementation:

Reference assemblies are a special type of assembly that contain only the minimum amount of metadata required to represent the library's public API surface.

For the actual implementation it's forwarding to other assemblies, the so-called implementation assemblies. One of these implementation assemblies is System.Private.CoreLib.dll.

like image 88
Alex Avatar answered Dec 07 '25 13:12

Alex