问题
I created a simple test program to try and understand how Click-Once deployment works and whether or not I can have the program automatically updated.
It is an excel add-in with a button in the ribbon that outputs some message box. I have the deployment location set to a public location on the network and updates set to check every time the customization runs. Great - I install the add-in, open Excel, it works fine. Now I go into visual studio and update and re-publish the add-in. Now when I open Excel I get an error that says an earlier version of this application is installed and cannot install the new one.
What do I need to do in order to get this to work? I see in the properties I can have a Pre-build event command line... so I am assuming maybe I need some sort of command line function to uninstall the old version before installing the new one? Not really sure how to go about doing this.
回答1:
This error is due to using the same computer in development and test. To test the update behaviour, here are the steps :
- set the update parameter to "each time the program launch"
- publish V1.0.1, and move the files to your webserver or other
- publish v1.0.2, and save the files apart for the moment
- Clean solution using Visual Studio
- install v1.0.1 from your server
- Move v1.0.2 to server (vsto + application files)
- Run again your solution and see the update process going through :)
来源:https://stackoverflow.com/questions/39798538/clickonce-automatic-update-error-for-vsto-add-in-for-excel