In the .NET BCL there are circular references between:
System.dll
andSystem.Xml.dll
System.dll
andSystem.Configuration.dll
System.Xml.dll
andSystem.Configuration.dll
Here's a screenshot from .NET Reflector that shows what I mean:
How Microsoft created these assemblies is a mystery to me. Is a special compilation process required to allow this? I imagine something interesting is going on here.
RBarryYoung and Dykam are onto something. Microsoft uses internal tool which uses ILDASM to disassemble assemblies, strip all internal/private stuff and method bodies and recompile IL again (using ILASM) into what is called 'dehydrated assembly' or metadata assembly. This is done every time public interface of assembly is changed.
During the build, metadata assemblies are used instead of real ones. That way cycle is broken.
Its pretty easy to do in Visual Studio as long as you don't use project references... Try this:
So this is how you do it. But seriously... Don't you EVER do it in a real project! If you do, Santa wont bring you any presents this year.