title: Possible to remove and add a reference to csproj programmatically via a batch file?
body: <p>I am writing a short batch file to prepare a control library DLL with Examples project for deployment via sip file and have the following question. </p>
  
  <p>Given a csproj file at known location and a DLL at known location, is it possible to programmatically update the csproj from the batch file (via third party command line exe, or other scripting) to add the new DLL? </p>
  
  <p>My folder structure is</p>
  
  <pre><code>/Build 
     /SDK
        /WPF
            /4.0 : ControlLibrary.dll sits here
     /Examples
        /WPF
            /4.0 : Examples.csproj sits here
  </code></pre>
  
  <p>Assuming the batch file is at the /Build level, is there any way to modify Examples.csproj to reference ControlLibrary.dll ?</p>
  
  <p>Just to clarify, the reason why I have the structure like this is I wish to deploy an examples csproj to ship with my control library. Examples.csproj should reference the obfuscated control library under SDK/. Examples.csproj also exists on dev trunk (where it has been copied from) and in the development solution it references output of ControlLibrary.csproj on non obfuscated form.</p>
  
  <p>Essentially what im creating here is a folder structure to zip up and ship the ControlLibrary plus examples, hence, the need to update the reference.</p>
  
  <p><strong>Update - Solved using Powershell</strong></p>
  
  <p>Please see this related question and answer on <a href="https://stackoverflow.com/a/8967946/303612">adding and removing references</a> using Powershell</p>