title: ClickOnce - File Already Exists Error - Why is a DLL File Trying to be Copied Twice by ClickOnce?
body: <p>Does ClickOnce only look at the application manifest file to determine which dll files to copy to the client’s machine or does it also interrogate the internals of an assembly to determine dependency files?</p>
  
  <p>The reason I’m asking is because I’m getting the below ClickOnce error when trying to launch a WPF .NET 4 application that has been published with ClickOnce:
   The file <code>C:\Users\CNelson\AppData\Local\Temp\Deployment\PGX6P33A.35N\AJQL8AC8.D60\tx16_rtf.dll</code> already exists.</p>
  
  <p>This error began after I’ve included a reference to two 3rd party .NET dlls that both reference an unmanaged dll file (tx16_rtf.dll). I want tx16_rtf.dll to be copied to the bin folder on the client’s PC so I have included it in my project and set the Build Action to ‘Content’ and the Copy to Output Directory to ‘Copy Always’.</p>
  
  <p>However, for some reason when I try to launch the application ClickOnce is trying to copy the file ‘tx16_rtf.dll’ twice, which results in an error.</p>
  
  <p>If I look at the deployment manifest file I can clearly see one and only one  entry for file ‘tx16_rtf.dll’. So, my question is, why does ClickOnce try to copy file ‘tx16_rtf.dll’ twice if it only exists once in the deployment manifest file?</p>
  
  <p>Below is a snippet of the deployment manifest file that references ‘tx16_rtf.dll’:</p>
  
  <pre><code>  &lt;file name="tx16_rtf.dll" size="839680"&gt;
      &lt;hash&gt;
        &lt;dsig:Transforms&gt;
          &lt;dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /&gt;
        &lt;/dsig:Transforms&gt;
        &lt;dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&gt;
        &lt;dsig:DigestValue&gt;V6i2QcARl3+1SJHCugoazb9zrOY=&lt;/dsig:DigestValue&gt;
      &lt;/hash&gt;
    &lt;/file&gt;
  </code></pre>