Profile photo
Submitted by Misuk Wang
on May 28th, 2011 at 11:18:46 EST

MSCorlib.dll vs system.dll and where to find this MScorlib.dll in the computer?

What difference between MSCorlib.dll and system.dll. I do not see any reference to MSCorlib.dll in my references in Visual studio. But I read that MSCorLib.dll is the main core framework assembly in .NET. Do I need to add reference to mscorlib.dll in .NET development? Where is the file path location for MSCorlib.dll in the computer?

Profile photo
Replied by Todd Dooley
on May 29th, 2011 at 09:14:14 EST
mscorlib = microsoft common object runtime library
in windowsxp, found in WINDOWS\Microsoft.NET\Framework\[version]

Both mscorlib contain core .net classes and system.dll contains some more common classes . only thing i can think of doing this is for scalability reason . I googled and couldn't find specific info on both the dll.

Profile photo
Replied by RaKumar
on May 29th, 2011 at 13:43:48 EST
MSCorlib.dll is the heart of .NET framework which contains all the type definition and most of the commonly used functionality. MSCorlib.dll is tightly bound to CLR, however System.dll is not tightly bound to CLR. MSCorlib.dll is loaded and bound in every .NET application, its the heart.

Why Microsoft includes both MSCorlib.dll and System.dll, most probably the plan was to keep MSCorlib.dll for the core functionality(and probably light) and System.dll for everything else. For example, System.Threading namespance includes everything except Semaphore which is implemented in System.dll. May be Microsoft thought everything related to Threading is core except Semaphore, I am not fully sure about the Microsoft actual architecture.
However, so far with .NET, MSCorlib includes most of basic functionality of .NET including type definition like int, string, bool etc and few functionality is included in System.dll.

Since mscorlib.dll is tightly coupled with CLR, you do not even need to reference mscorlib.dll explicitly. Its being reference implicitly for every .NET application.
Accepted Answer

Profile photo
Replied by RaKumar
on May 29th, 2011 at 13:44:32 EST
for your reference, here is another good discussion on MScorlib.dll and System.dll.

Profile photo
Replied by Misuk Wang
on May 30th, 2011 at 20:19:32 EST
Thanks all.