Search code examples
c#clickoncepublishauto-update

clickonce update of visual studio not working


I publish my application from project properties of visual studio and i set the update-path to one of my local drivers E:\WebSiteupdate. The update must run before application starts but i do not really know what should i put on E:\WebSiteupdate to update the application.

here what i used to do for update:

  1. another publish from new application
  2. copy all of new publish folder in E:\WebSiteupdate

but nothing happened and still show old program

what kind of files should i put on update path for update application?


Solution

  • Clickonce's auto updates are meant to update installed applications. That has nothing to do with the project run from VS. When you set Update location, each time the app launches it will check for a newer build/publish in that location. If there is a different build, it will automatically update your installed app. To answer your question what kind of files...? Its is the same contents that you get while you publish your app.

    To try this:

    1. Set your Upload location(Project properties --> Updates...) to a path accessible from your pc.
    2. Publish your app to a different location lets say D:\Publish\
    3. Install the app in your pc. There should be D:\Publish\setup.exe. Double-clicking that will install. This will put a shortcut menu in the start menu.
    4. Make any minor change in the UI of your project (in VS).
    5. After clearing the contents in D:\Publish do another publish.
    6. Clear the contents from the Update location and copy over the contents from D:\Publish.
    7. Now (don't do another install) close (if already open) and open the app again (shortcut should be present in Start menu)

    The app should update automatically before opening. This is how we are expected to give app updates to the clients. Further, if you like to automate this I found the below link by deadlydog very helpful: http://blog.danskingdom.com/continuously-deploy-your-clickonce-application-from-your-build-server/