C# Design – Benefits of Circular References

Architectureccode-qualitydesignnet

I recently found out that circular dependencies exist between some .Net assemblies from the following question and I'm looking for some explanation of why these exist:

https://stackoverflow.com/questions/43505621/circular-reference-in-net-assemblies

I've seen plenty of reasons to avoid circular references but are there any benefits? If not, then what is the historical reason of why these exist and why haven't they been cleaned up?

Best Answer

I can conceive of only one benefit of having a circular reference, and even that is rather dubious: less libraries/modules. In order to resolve such a reference between two entities A and B, one usually needs to introduce a third entity C that contains whatever A and B need in common:

Resolution of circular dependencies

I think that circular dependency was introduced by mistake, and now it is too late to disentangle the libraries involved because, for example, it will break backwards compatibility through the relocation of some public classes or methods.