[Mono-list] mscorlib.dll

Pinku Surana surana@cs.nwu.edu
Fri, 19 Jul 2002 16:17:12 -0500

I dredged up this old note on the mailing list to help explain a
compilation error. The problem with the hack described below is that
other tools will not be written to support this magic renaming. In
particular, Portable.NET's ilalink will not redirect references to
mscorlib to magically go to corlib instead. Would it be too terrible
to have another corlib signed as mscorlib? 


On Sat, 2002-04-20 at 20:05, Hamazasp Asaturyan wrote:
> There is one question I have regarding mscorlib.dll. When a .NET
> assembly is built using the Microsoft compilers, it includes
> (as far as I know) a static dependency on mscorlib.dll. However,
> on Mono, this file is named corlib.dll, ommiting the "ms" prefix.
> How will the Mono class loader know where to load the .NET
> System classes from? Will you also provide a file called mscorlib.dll?

Good question! Here's the answer from assembly.c in the mono library:

        if ((strcmp (name, "mscorlib") == 0)     ||
            (strcmp (name, "mscorlib.dll") == 0) ||
            (strcmp (name, "corlib.dll") == 0)   ||
            (strcmp (name, "corlib") == 0))
                return g_concat_dir_and_file (MONO_ASSEMBLIES,

Basically corlib is aliased as mscorlib.