ClickOnce is a technology that allows developers to write Windows Forms applications that utilize the
powerful features of the client, yet are as hassle-free to deploy and update as a Web page.
ClickOnce provides a rich set of easy to use capabilities for deploying and updating smart client applications,
including lots of options and ways of approaching things. Once you understand how to get your application out the
door and updated, using the myriad of options that ClickOnce provides, lots of other questions arise, including how to make it more secure and how things will change in the future.
Do you agree with them all? Are we missing some? Let us know
what you think.
The Assembly and File Version should be the same by default
For the purpose of consistency, version numbers should be the same there are few exceptions. One exception is for backward compilation:
If you have other .dll files depend on the assembly, changing Assembly Version will break these dependencies and then cause a crash in your application. So you can keep the Assembly Version unchanged and increase the File Version when you release new build. It is easy to maintain the version numbers in VS.NET 2005, but we have some suggestions on modification of version numbers in VS.NET.
-

Do you keep the version in Sync (in all 3 places)?
The Assembly Version, File Version should be in Sync 95% of the time. The only case is backward compatibility.
If you are using ClickOnce for deployment, you also need to keep the Publish Version in sync also. Yes that is 3 places Microsoft should make this easier. See suggestions on modification of version numbers in VS.NET
Do you set the appropriate download (.exe or .application) for your web users?
In general, you should set the user to download the Setup.exe of your ClickOnce application. However there are many cases where the only prerequisite of the application is .Net 2, and the users don't need the Setup.exe.
Instead, the .application file would allow the user to install the application, or run it instantly if they already have .Net 2.
The following code allows you to check for the .Net 2 runtime on the client's machine (note: Request.Browser.ClrVersion may return 0.0 on some browsers).
-
dim verHave as Version = Request.Browser.ClrVersion
dim verNeed as Version = new Version("2.0.50727")
if ( verHave < verNeed ) then
Response.Write("<a href=""./Download/Setup.exe"">")
else
Response.Write("<a href=""./Download/SSWDiagnostics.application"">")
end if
-
Figure: Code to detect the client's CLR version and offers the download accordingly
Note: SSW Diagnostics uses this code on its homepage.
Do you make a clear symbol to inform the users that you are using a ClickOnce version application?
If you use ClickOnce to deploy your application, you should clearly show a symbol indicating this is a ClickOnce version application.
ClickOnce makes applications enjoying convenient update, maximizing to keep the safety of the users' system environment.

- Good Example: Showed a symbol indicates this is a ClickOnce version of application.

- Bad Example: No any symbol indicates this is a ClickOnce version of application.
Acknowledgements
Adam Cogan
Marten Ataalla