0

I am facing a circular reference issue which I am unable to come up with a solution to.

Project Overview Diagram

Under a solution I have 3 projects, 2 class libraries (A and B), and a main application (C). Projects A and B both contain User Controls which are of a different business nature, thus split into different projects. Project C is the main window which brings all these separate controls together and references A and B's controls.

Since there are aspects of A and B which are general in nature, we would like controls in A and B to directly call controls of one another. However we can't do this because it creates a circular reference, which will not allow the project to build.

I have done research and found that interfacing is a solution but unable to find a place for it in my situation.

  • Possible duplicate of [Circular reference among two .net assemblies](http://stackoverflow.com/questions/3501242/circular-reference-among-two-net-assemblies) – Yusuf Tarık Günaydın Feb 26 '16 at 16:35
  • Along the lines of the thread you referenced, I've managed to come to a solution using [MEF](https://msdn.microsoft.com/en-us/library/dd460648(v=vs.110).aspx) – Grant Camilleri Mar 01 '16 at 14:49

1 Answers1

0

My suggestion would be to combine projects A and B into a single project. You can separate the business concerns via separate sub folders for the source files and/or using separate namespaces. Since there would then be only one controls project to reference, you should have no further issue with circular references.

Kevin
  • 1,462
  • 9
  • 9