title: ms Build engine find existing item or remove duplicate items
body: <p>I am currently working on an application that generates C# code files and adds them to an existing project. To edit the project I'm using Microsoft.Build.BuildEngine, and loading the exisiting .csproj file into the Project class.</p>
  
  <pre><code>csproj = new Project(new Engine(),"3.5");
  csproj.Load("/myproject.csproj");   
  </code></pre>
  
  <p>After wich I am able to add refeneces and compile items as I need. However I do not know if the files or references are already in the .csproj file, so currently they get added multiple times, which I do not want.</p>
  
  <p>for example:</p>
  
  <pre><code>    &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System" /&gt;
      &lt;Reference Include="System.Core" /&gt;
      &lt;Reference Include="System.Core" /&gt;
  </code></pre>
  
  <p>Does anyone know of a way I can check if a builditem exists before I add it to the project? Or of a way to remove duplicated builditems after I've added them?</p>