List Of ClickOnce Articles

Here’s a quick reference to my ClickOnce articles.

Windows 8 and ClickOnce — the definitive answer explains how ClickOnce applications work on Windows 8, and what you need to do if you are deploying from the internet zone.

Host your ClickOnce deployment for pennies per month explains how much it costs to use Azure blob storage to serve up your ClickOnce deployments. It’s dirt cheap!

How to host a ClickOnce deployment in Azure blob storage explains how to use Azure blob storage to serve up your ClickOnce deployments. If you don’t have access to a server, this can be a really inexpensive way to host your ClickOnce application.

How about a bootstrapper package for SQLServer Express 2008 R2? explains how to make a bootstrapper package for the latest version of SQLServer Express to use as a prerequisite to a ClickOnce application.

How do I programmatically find the deployed files for a VSTO Add-In? explains how to write code to be used in an Office Add-In written with VSTO to access the deployment files. Hint: It’s not in the same place as the executing assembly.

MIME Types for ClickOnce deployment details the required MIME types required for the different applications you can deploy with ClickOnce, and shows you a way to define them yourself if using an Apache webserver.

Enhanced logging in ClickOnce deployment to help you diagnose installation problems.

What’s new in ClickOnce deployment in .NET 4.0 summarizes the new features available in VS2010 and .NET 4.0, and provides links to articles providing more detail.

The Future of ClickOnce Deployment talks about the continuing support from Microsoft.

How to pass arguments to an offline ClickOnce application, even if it’s deployed to a file share. This came along with the release of .NET 3.5 SP-1 (when they added file associations), and most people don’t realize you can do this now. I show you how to call a ClickOnce application and pass the arguments in different ways, and how to read and parse them in the application itself.

How to deploy the SQLServer Compact Edition software locally rather than deploying it as a prerequisite, which gives you control over the version installed and reduces the installation steps for your customer.

The published MSDN article about ClickOnce deployment and Certificate Expiration. This explains the problem that can occur when your signing certificate expires, in what cases it applies, and how to handle it. This is the updated and official version of my blog posting about this subject. This also includes how to use MakeCert to make your own certificates.

How to extend an existing certificate, even if it has expired. This explains how to use RenewCert. This is a companion article to the MSDN article on Certificate Expiration.

How to move a ClickOnce deployment from one deployment location to another.

Installing a ClickOnce application for all users (short answer: you can’t). I asked the product team about this again in February 2010, and it is completely counter to the design of ClickOnce deployment, so I wouldn’t expect to see if any time soon.

Where do I put my data to keep it safe from ClickOnce updates? This offers a solution that gives you more control over when your data is modified, and makes sure it doesn’t get lost when you publish an update to your application.

How to deploy a ClickOnce application to localhost. If you install IIS on your development computer, you can deploy your application locally and test your deployment from either your development computer, or another computer on the same network.

How to create a desktop shortcut for your ClickOnce application. This shows how to do this programmatically.

How to create a desktop shortcut for your ClickOnce VB application. This is an addition to the first article. The startup of a VB application is different from a C# application; this addresses that difference and shows VB developers how to handle it.

Microsoft Windows Updates and .NET 3.5 SP-1 How to migrate from .NET 2.0 or .NET 3.0 to .NET 3.5 SP-1, and information about the Client Framework.

How to install multiple versions of the same ClickOnce application. You would want to do this if you wanted to have both the production version of your application and a QA version installed at the same time.

ClickOnce and Expiring Certificates This is the original version. I’ve left this in for nostalgia and because it is the first post on my blog. You should read the MSDN article for the final and official version. This one is accurate, but the MSDN article is more thorough and includes .NET 4.0.

31 Responses to “List Of ClickOnce Articles”

  1. Walt Kraybill Says:

    In ClickOnce if an XML file is changed in the source publish directory on the server without re-publishing the application, will the clients pick up that the file changed and download the affected XML file?

    • robindotnet Says:

      Short answer: No. First of all, if you change the file on the server, your customers will not be able to download the deployment at all, because the hash on the file will be different from what it is in the manifest. You could change the file and then re-sign the deployment with mage or mageUI, but it still wouldn’t be picked up. For ClickOnce, you need to publish a new version, or update the version that’s there. ClickOnce only installs an update if the server has a different version number than the client.

  2. Domnica Says:

    Hi,

    I have some files needed for the application to run (dll-s that I cannot add as references because they are not .NET-style, other config files, etc, so they are not deployed by ClickOnce technology), so after publishing the app, I will copy by hand these files to the server, and when app starts I want to copy them dinamically from server to client local disk. (if this is the very first time the app is running on that machine and these files don’t already exist on local disk). They will not modify from one version to another, so I won’t copy them to server every time.

    To copy these files from server to client, of course I have to know server (deployment) location and client location (directory where the app starts on local disk).

    For server location I tried to use ApplicationDeployment.CurrentDeployment.UpdateLocation, but it gave me http://193.33.94.254/MyApp/ MyApp.application (the content of deploymentProvider tag), so not the place where I can find those files I copied by hand.

    For client location I tried to use ApplicationDeployment.CurrentDeployment.DataDirectory, but again this is not the directory from the local disk where the .exe locates.
    So I guess for client side I could use the old System.Windows.Forms.Application.StartupPath, right?

    But what can I do about server location? How to obtain http://193.33.94.254/MyApp/ Application%20Files/ MyApp_1_0_0_7/ let’s say?

    Thanks,
    Domnica

    • robindotnet Says:

      Hi Domnica,

      First, system.windows.forms.application.startupPath will work if it’s a desktop app. You can also check my blog post about finding your files in a VSTO application, the codebase property of the assembly should also work for a desktop application.

      Second, you can’t find the deployment provider URL unless it is an online-only application. You only choice is to hardcode it in the app somewhere (never a good idea).

      Third, this seems like a lot of trouble. You should be able to add the dll’s to your project and on each one, set the build action to content and set “copy to output directory” as “copy always”. If you do that and build it, you should see them in the \bin\ folder. If you then check the Application Files dialog, they should be displayed there. They will be included in the deployment in the same folder as your [exe]. You can even put them in a subfolder under your project and set the properties as noted, and they will show up in a subfolder under your [exe]. (This is what we do with 3rd party dll’s).

      Note that ClickOnce does incremental updates. So if you deploy those dll’s and they don’t change, when ClickOnce checks the application manifest (the app.exe.manifest file) for the list of files, it compares the info on the files against the local copy, and if they are the same, it copies it from the local cache to the new folder instead of copying it from the network again.

      Hope this helps.
      Robin

  3. Domnica Says:

    Hi Robin,

    Thank you very much for your response.
    Yes, these dll’s I added them to my project and manage to be deployed, so it’s ok. They never change.

    The main problem are the config files, some of them should be copied to client local disk because they should be modified locally (for example one of them keeps the last username logged in the application – this information should remain local, so the user on that computer can login next time with the same username).
    So I don’t want them to be deployed.

    So I used ApplicationDeployment.CurrentDeployment.UpdateLocation, obtain something like http://193.33.94.254/MyApp/MyApp.application, remove “/MyApp.application” from the string and it remains http://193.33.94.254/MyApp, that should be the directory on the server where the updates comes from. Is this completely wrong? I saw this on some post….

    So these config files I will put them by hand on the server, the application will copy them (from code) if they don’t exist already locally, in ApplicationDeployment.CurrentDeployment.DataDirectory, and they will remain there, at least until the next update.
    Dou you think this is ok?

    Thank you again,
    Domnica

  4. FrancescPG Says:

    Dear Robin.Net:

    Your blog is amazing! There are lots of useful information.

    However, I’ve found some difficulties while trying to deploy an application: I have got a windowsForms application, which uses severeal Libraries (also included in the current solution). The problem is that these libraries has their own resources, which I have added by setting them as “content” and putting “always copy” in the “copy in the results directory” property.

    Well, when I try to publish my application, these resources won’t get copied and I can’t find them in the (app folder)/resources/…

    Particularly, I have added a very heavy directory (more than 300 mb) which are input files for one of the processes that my application performs.

    • robindotnet Says:

      Thanks for your feedback, I’m glad you’ve found this helpful.

      For the resources belonging to the other libraries, I know one person in the forums had that problem, and they ended up adding links to those resources to the main project, so it would include them in the deployment. That way, they only had one copy of the resources, but they were picked up because the main project linked to them.

      300MB? Really? You’re deploying 300MB every time? Do these files change, or are they static? They should only get copied down the first time. ClickOnce caches the downloaded files, and if they don’t change, uses copies from the local cache instead of downloading them again. (note: doesn’t change means you also don’t recompile them). However, if it doesn’t work for you for some reason, there are some other ways to get those files.

      You can kick off a background thread and download them from the server using the WebClient class. This way, you could make sure you only download them once. I would put them in LocalApplicationData (see my blog article about keeping your data safe from ClickOnce updates).

      Another thing we did was we created a small WinForms app that had a bunch of resources. The application installed, and then copied the resources over to LocalApplicationData so the ClickOnce application could find them. We would show the UI that showed it copying the files, and then shut it down. We deployed this as a ClickOnce application. In our case, the user ran it separately, but we could just as easily have had our main application check for the files, and if they weren’t there, invoke the resource application. Sneaky, but effective.

      Just something to think about. Good luck.

      Robin

  5. Rajeev Singh Says:

    Hi Robin,

    I have one strange issue with the Clickonce build. I am using NAnt build script for building the project
    and creating the deployment files.Everything is running fine.

    we have build server from where one job is running to execute the batch file which calls the build scripts.

    Issue: we are using a web portal to run the job. After running some steps the job is throwing an exception while
    signing the manifest files the message : Unable to open the certificate. The system cannot find the file specified

    whereas all the files and certificate are at same place.The same build script is running successfully locally and also at the server.
    But the error comes only if the build server is in loggeg off state .

    The work around as of now we have that we need to login to the server through RDP and then run the job from the web portal by doing
    the job is successfully executing.

    Looking for a permanent solution so that if new developer wants to build he just have to run the job from the portal.

    Any suggestion how can I fix this issue.

    Rajeev

  6. DDatabasin Says:

    Thanks for the great articles (and flow chart). I have a quick question though – our application is a standalone Access MDE along with the DSN to connect to the SQL Server for linked tables. For the purposes of your flow chart, would this qualify it as a VSTO application?
    Thanks,
    DDB

    • robindotnet Says:

      No, VSTO stands for Visual Studio Tools for Office, which is developed using Visual Studio. If your application is contained within Access, it is not a VSTO app.

  7. BFerguson Says:

    Robin,

    I am not a programmer and don’t know anything about oneclick technology. What I have is a problem with my virus scanner slowing a oneclick application down. How do identify the target application to my virus scanner exclusion list (MacAfee) and not just the application reference file?

    • robindotnet Says:

      I doubt it has anything to do with ClickOnce applications; it probably scans anything that comes across the internet to your computer. Have you actually run the installation of the application with McAfee turned of versus turned on and seen a discernible difference? But only with C/O apps, or with anything? If this is really the case, recommend you ask the McAfee people.

  8. Ramesh Says:

    Hi Robin,
    I have a question here. With ClickOnce technology, is there any possibility that we can place the custom Help file (external file) in Start –> Program Files? When clicking on the Help link, the file should open. This can be easily achieved in the traditional Setup and Deployment project. Please let me know if this is possible with ClickOnce. My email id : ramesh.pothuraju@gmail.com

    thanks,
    Ramesh.

    • robindotnet Says:

      ClickOnce won’t do that, but you can do that programmatically from your application. Just have it check the start menu for the option, and if it isn’t there, add it. If it is a file type already recognized by Windows (like CHM), it should work.

  9. Jignesh Sura Says:

    Hi Robin,

    I have a quick question about ClickOnce. Initially we installed our product to our clients machine using Clickonce and now we are moving to MSI approach. i wanted to know if there is a way to remove the Clickonce version from client machine.

  10. sharan Says:

    Hi Robin,

    I published my clickonce app to my local pc. I created a batch file to launch the app. But i dont know how to pass arguments to the app. If i give something like ///.application? , i am getting errors.. Help me..

  11. Francesc Says:

    Dear RobinDotNet,

    I would like to publish my app using clickOnce deployment. There a problem, though: let’s supose you a have a Windows forms application (project A) that references a class library project (project B). Suppose project B has got one or severel data files (such as text files, images, excel…). How on earth do I get this files in my deployment? It seems that the resources in the secondary assemblies don’t get copied in the deployment destination. Do I need to manually add the resources into the main project?

    Thank you in advance!

    • robindotnet Says:

      You’re right, secondary resources are not included in the main deployment. To get the files in the deployment, you have to add them to the main project. You should be able to do that, and reference them there from the secondary assembly.

  12. Jason Says:

    Hi Robin,

    I was just reading your article regarding ClickOnce and expiring certificates (http://msdn.microsoft.com/en-us/library/ff369721.aspx). Of particular note is the mention of .NET 4.0 taking care of the issue in all cases. it seems there is at least one case where there is still an issue.

    When trying to move a ClickOne deployment (as explained in http://robindotnet.wordpress.com/2010/01/17/how-to-move-a-clickonce-deployment/) if your deployment in the new location is signed with a different certificate than the one used to sign the deployment in the original location you will still get an “Applicatoin cannot be started” error when trying to run the app. The actual error in the detail summary is “The deployment identity at the deployment provider is not the same as the original deployment identity.”

    • robindotnet Says:

      I would doublecheck your URLs. Starting with .NET 3.5, the certificate is part of the identity, but doesn’t trigger any errors about the identity changing. If it did, it would do it in all cases, not just this one.

  13. Tobias Smoktun Says:

    Hi Robin,

    i working on a problem, which i can’t fix.
    I published my application locally and moved it to an VM. i can install this app.
    when i publish a newer version of my app locally and move it to my VM, the application doesn’t recognize the newer version…
    i moved the app_0_1_2_24 folder and moved and replaced the app.application and the setup.exe .. how can i fix this ?

    • robindotnet Says:

      You’re copying the deployment to the VM and trying to install it? What is your installation URL, and are you sure you are replicating the publishing folder exactly right? The top folder has the .application file and setup.exe. Under that is the Application Files folder, and in that is the versioned folder.
      Robin

  14. Marouane Timsahi Says:

    Hi I’ve published my application through ClickOnce option in VS 2008 to a ftp account in a Linux hosting when I’want to install application this error occurred the application is improperly formatted then I think is a problem in types (.application .manifest) and I’ve apply this post (MIME Types for ClickOnce deployment ) in your wordpress blog an without any positive result :s

    really i want your help plz

    • robindotnet Says:

      Are you trying to install the application with FTP, or with HTTP? (FTP doesn’t work for installing, just for deploying). Please post more information, or post your question to the MSDN ClickOnce forum.

  15. James Says:

    Hi Robin and thanks for your help in advance.

    We are having problems with a subgroup of customers running Firefox/Chrome and NOT having .NET Framework Assistant enabled. This results in xyz.Application download instead of offering them an option to run the clickonce app. Of course, some of them download the application and try to launch it from explorer subsequently, which results in an startup error “Deployment and application do not have matching security zones.”.

    Do you think is there an intelligent workaround? How could we achieve 100% success on running the app?

    Thanks,
    James

    • robindotnet Says:

      We messed around with this quite a bit, and couldn’t come up with a clean solution. What we ended up doing was on the web page where they can install the product, we put a small “Not using Internet Explorer?” link. It looks like this. The links are live, pointing to the different plug-ins needed. This did help. The only 100% solution I can think of is for Google and Firefox to acknowledge and handle the MIME type for the deployment manifest (.application file). The irony is that Google uses ClickOnce to install Chrome, but then doesn’t support it in Chrome.

  16. BAckouche Says:

    Hello,

    I found a solution that I’ll be glad to share with you. You can do it with MageUI or with Ms VIsual Studio. I am really delighted to use ClickOnce as my deployment now works both with IE and CHrome and FIrefox :)

    If you MageUI, you have to check “Include the provider URL in the Manifest” and type the associate URL of the Webserver. If you use Microsoft Visual Studio, then on the Publish Tab property of the project, click on the “Update” button, then in the update location, type the URL of the publishing Web Server.

    Hope this helps,
    Philippe Backouche

    • robindotnet Says:

      Thanks, Phillippe. I’m not really sure what problem that is a solution to. If you’re talking about the Firefox/Chrome issue, the problem is that they do not recognize the MIME types for a ClickOnce deployment, so you end up having to download the .application file and double-click on it to run it, which doesn’t always work. AFAIK, the only way to get ClickOnce to work the way it’s supposed to for those browsers is to install the add-ins for those respective browsers.
      Robin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 55 other followers

%d bloggers like this: