title: .NET Remoting to WCF - Structuring solution to avoid circular dependency
body: <p>I'm trying to convert an existing project that uses .NET Remoting to use WCF. The structure of the project is as follows:</p>
  
  <ul>
  <li>UI</li>
  <li>BusinessLayer</li>
  </ul>
  
  <p>The BusinessLayer project is a class library that contains the Client-Activated Object <code>DistributedProcessor</code> which has the method <code>IResult Process(IJobProcessor)</code>. The <code>IJobProcessor</code> and <code>IResult</code> interfaces and concrete classes are all within the BusinessLayer library. The concrete classes of <code>IJobProcessor</code> in turn use many, many classes within BusinessLayer.</p>
  
  <p>For .NET Remoting this situation is ideal. The distributed part is a just a Windows service that contains BusinessLayer and listens on a specific port. The client side creates the remote object using <code>Activator.GetObject()</code>.</p>
  
  <p>To convert this to WCF I realized I have a circular dependency issue if I structure the project as follows:</p>
  
  <ul>
  <li>UI</li>
  <li>BusinessLayer - references WcfService</li>
  <li>WcfService - references BusinessLayer</li>
  </ul>
  
  <p>The service needs a reference to BusinessLayer so that I can transfer the objects over the wire. The BusinessLayer needs a reference to the WcfService so that it can call the <code>IResult Process(IJobProcessor)</code> method on the WcfService.</p>
  
  <p>Can I move the interfaces <code>IResult</code> and <code>IJobProcessor</code> out into a separate project BusinessLayerDistributed, such as:</p>
  
  <ul>
  <li>UI</li>
  <li>BusinessLayer - references BusinessLayerDistributed</li>
  <li>BusinessLayerDistributed</li>
  <li>WcfService - references BusinessLayer, BusinessLayerDistributed</li>
  </ul>
  
  <p>My question is: If the concrete classes for all these interfaces are still in BusinessLayer, will the <code>IResult</code> and <code>IJobProcessor</code> objects be properly hydrated as their concrete class when transferred to the service? Is there any trick to doing this with WCF?</p>