title: WCF Service that returns a custom class generates errors in Reference.cs
body: <p>I have a WCF Service project in Visual Studio 2008 that contains about 12 methods, some of which return primitive types like bool or string. I also have a Visual Studio Unit Test Project that references the published WCF Service. The Test Project compiles successfully when all the return types are primitive.</p>
  
  <p>If I add a new method to the service that returns a custom class, publish it and update the service reference in the Test Project, it doesn't compile. The errors are: -</p>
  
  <ol>
  <li>The type 'PublisherFaultException' already contains a definition for 'Reason'.</li>
  <li>The type 'PublisherFaultException' already contains a definition for 'PropertyChanged'. </li>
  <li>Type 'Publisher.Test.LibraryReference.PublisherFaultException' already defines a member called 'RaisePropertyChanged' with the same parameter types.</li>
  </ol>
  
  <p>all in the auto-generated reference.cs file.</p>
  
  <p>The contract for the method of the WCF Service is: -</p>
  
  <pre><code>Page GetItem(string path);
  </code></pre>
  
  <p>and the Page class has the DataContract attribute and it's public properties have the DataMember attribute.</p>
  
  <p>I'm reluctant to modify the Reference.cs file as I'll need to do this every time the Service is updated.</p>
  
  <p>Anyone know why this is happening?</p>
  
  <p>Stuart.</p>