Remark : If you’re not using FinalBuilder but plain MSBuild, you can most likely benefit from the tutorial below as well.
In this tutorial I’ll try to explain what I’ve done to automate the build for a ClickOnce application. I’m using FinalBuilder because this is the best tool I know to automate your build. What MSBuild requires you to do in huge XML files, FinalBuilder lets you do in an excellent GUI where you can set breakpoints, step through, etc, etc. I’ve used it since ages and can’t live without it anymore. So should you!
ClickOnce uses two manifests, the application manifest and the deployment manifest. I won’t go into details, read more here on MSDN. Visual Studio normally does all magic for us, but as I’m a control freak, I want to do everything myself using the command line tools Microsoft provides. How you manually deploy a ClickOnce application is described step by step here on MSDN. But from the comments to that article, you already might expect some stuff is missing.
Here are the complete steps to ClickOnce deployment
If you repeat this 100 times and increase the version number a bit every time, you should have an automated ClickOnce application deployment. Remember that if you perform this from your source repository like Team Foundation Server, you should not provide your end-users with this build. This is the integration build. You should create a production build as well, but store it in a folder from where you can deploy everything once you’re done developing.
So how is this done in FinalBuilder? I’m using version 6.x, although I think version 5.x will do just fine.
We’re done, you should now have a package that’s ready to deploy.
If there are any questions, don’t hesitate to ask them. Please do so in the comments below so other readers will know what has been playing and how we solved the problems.
REMEMBER : No trailing slash with “Application files” folder!!!
REMEMBER : When you don’t have a password on your certificate, don’t supply the parameter to mage. It might return an internal error.
You might run into a problem that the assembly was signed by a different key than the manifest. You'll get this error:
"Reference in the manifest does not match the identity of the downloaded assembly xxx.exe"
The answer can be found here : geekswithblogs.net/.../117449.aspx
Go to project properties, see the section "Resources" in the application properties and in the icon manifest options, set it to "Create application without a manifest".
We also use FinalBuilder for building Inbox2, but we simply call visual studio from the command-line to build & deploy the clickonce application.
See: msdn.microsoft.com/.../ms165431(VS.80).aspx
Your tutorial does offer a lot more flexibility though :-)
If you want to automate the deployment of ClickOnce apps in FinalBuilder, Dennis van der Stelt has posted an excellent tutorial on bloggingabout.net. Check it out and if you have any questions, conta ...
As Dennis Doomen , I was quite happy with how the session went. Some stuff went by pretty fast, mainly
Does anybody knows, a tutorial that for FinalBuilder that will automated my built, to change just the version number. For example, I know that my built for my software version 6.0 is working, so I just want to take that built, and just change the version number to 6.1, without going to VS and built the code again.
Thank you
sincerely
Diego
@Diego : You do have to rebuild you code, but isn't that part of your build already? It should be! First increase the build number in AssemblyInfo.cs, then build the code.
This tutorial is great, but I have a particular concern, After I publish my solution from .net, this include create a PA ClickOnce Deployment utility, setup files ready for the client. What can I do with FinalBuilder to take the xtm file, where the version number is, and change the version number, then remove the deploy extension, sign the manifest, and add the deploy extension back. We can do it manually, but we want automatize that process any ideas??
Therefore the basic question is: How to Change App Version Without Rebuilding?
I get this error message
Following errors were detected during this operation.
* [11/23/2009 6:05:12 PM] System.Deployment.Application.DeploymentException (ManifestSemanticValidation)
- The customHostSpecified attribute is not supported for Windows Forms applications.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at
@Rajesh : That's not the entire msg. Contact me via this page (bloggingabout.net/.../contact.aspx) and we can discuss this offline.