ClickOnce MSBuild Resigning Task#

File Attachment: ClickOnceTasks.zip (11 KB)

Leveraging the code that MS Patterns and Practices released for ClickOnce I made a MSBuild task to resign a ClickOnce deployment.

Scenario:  Moving a ClickOnce deployment from a QA environment to a Production Staged then again to Production.

A ClickOnce deployment must be resigned if files are changed, say the download URL and/or the client configuration file change.  Using this MSBuild task I was able to automate the moving of a ClickOnce deployment to different environments.  This task is very simple but got the job done.  An example of the usage is shown below.

<Project DefaultTargets="UpdateClient" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 <UsingTask TaskName="ClickOnceTasks.SaveAndSignManifest" AssemblyFile=".\bin\Debug\MsbuildTest\ClickOnceTasks.dll" />
 
 <Target Name="UpdateClient">
  <SaveAndSignManifest FileName="Example.application" CertPath=".\Example_TemporaryKey.pfx" DeploymentProvider="
http://localhost/ExampleClient/Example.application" />
 </Target>
 
</Project>

The files are first copied and changed to the the new download location then the above tasks is run to resign the ClickOnce deployment. 

Saturday, November 25, 2006 3:41:43 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview
All content © 2009, John Luif