title: Migrate ClickOnce certificate from Sha1 to SHA256 and run on .NET 4.0 client machines
body: <p>After discovering the signing issue with .NET 4.5 vs .NET 4.0 when upgrading from an SHA1 to an SHA256 signed certificated, I decided to re-implement our ClickOnce build process to follow a more standard approach so I could make use of VS2013 Update 3.
  However it didn't seem to have an effect.  I know that the manifest is being built and is working correctly as it installs fine on any machine running .NET 4.5, however .NET 4.0 apps still fail.</p>
  
  <p>I use CruiseControl.NET to manage our builds
  To do run the builds I use one of these two tasks, but get the same result.  A .application file which works on .NET 4.5 but not 4.0 with the errors mentioned in the article
  For Example:</p>
  
  <pre><code>`&lt;devenv&gt;
      &lt;solutionfile&gt;$(SolutionFile)&lt;/solutionfile&gt;
      &lt;configuration&gt;$(Config)&lt;/configuration&gt;
      &lt;buildtype&gt;Build&lt;/buildtype&gt;
      &lt;executable&gt;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com&lt;/executable&gt;
      &lt;version&gt;VS2013&lt;/version&gt;
  &lt;/devenv&gt;`
  </code></pre>
  
  <p>Or with MSBuild:</p>
  
  <pre><code> &lt;msbuild&gt;
     &lt;executable&gt;C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe&lt;/executable&gt;
     &lt;workingDirectory&gt;$(WorkingDirectory)&lt;/workingDirectory&gt;
     &lt;projectFile&gt;$(SolutionPath)&lt;/projectFile&gt;
     &lt;buildArgs&gt;
       /p:Configuration=$(Config) /p:BuildFolder="$(BuildFolder)" 
     &lt;/buildArgs&gt;
     &lt;targets&gt;clean;publish&lt;/targets&gt;
   &lt;/msbuild&gt;
  </code></pre>
  
  <p>i've tried setting the toolsversion in the msbuild args, as well as a number of other approaches, but nothing seems to work and forces my end user to uninstall and re-install which I'm attempting to avoid.</p>
  
  <p>I've been battling with ClickOnce for the past two weeks in order to try and prevent any issues with migrating to a new certificate, but I can't seem to get this last piece working right.  Any guidance here at all would be greatly appreciated.</p>