How did Microsoft create assemblies that have circular references?

I can only tell how the Mono Project does this. The theorem is quite simple, though it gives a code mess.

They first compile System.Configuration.dll, without the part needing the reference to System.Xml.dll. After this, they compile System.Xml.dll the normal way. Now comes the magic. They recompile System.configuration.dll, with the part needing the reference to System.Xml.dll. Now there’s a successful compilation with the circular reference.

In short:

  • A is compiled without the code
    needing B and the reference to B.
  • B is compiled.
  • A is recompiled.

Leave a Comment