locked
ClickOnce Deployment with VSTO Excel Add-In RRS feed

  • Question

  • My employer wanted to use ClickOnce for our Excel Add-In mainly for the automatic update capabilities. However, it doesn't seem to be working. I put an updated version of the ClickOnce installer at the target website, ran Excel on the client system, and it hit a runtime Exception dialog (text pasted below).

    What am I doing wrong? What is the point of auto-update, if the user has to manually uninstall through add/remove programs?

     

    Name:

    From: file:///C:/VST03/TestAddin/TestAddin/bin/Debug/TestAddin.vsto

     

    The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestAddin. Then install the new customization from the following location: file:///C:/VST03/TestAddin/TestAddin/bin/Debug/TestAddin.vsto

     

    ************** Exception Text **************

    Microsoft.VisualStudio.Tools.Applications.Deployment.AddInAlreadyInstalledException: The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestAddin. Then install the new customization from the following location: file:///C:/VST03/TestAddin/TestAddin/bin/Debug/TestAddin.vsto

       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySolutionCodebaseIsUnchanged(Uri uri, String subscriptionId, Boolean previouslyInstalled)

       at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

    Thursday, February 21, 2008 11:32 PM

Answers

  • hello Evaristo9,

     

    it looks like you are developing and installing on the same computer.  when you build or publish, that is considered the first installation.  when you install from IIS, that's the second installation. this is why you are seeing the error message: the location of each add-in is stored in the registry and checked during the installation. this is a quirk of Office because add-ins have to be registered for each application.

     

    to avoid seeing the error message, there are a few workarounds:

    1. test your deployments from a different user account on your development system.

    2. use a second computer to test the installation and updates.

     

    m.

    Friday, February 22, 2008 5:43 PM

All replies

  • What this is saying is that there is an add-in, TestAddin, was installed on that machine from a location other than file:///C:/VST03/TestAddin/TestAddin/bin/Debug/TestAddin.vsto  ClickOnce doesn't support having the same add-in (based on something called a "subscription identity") installed from 2 different locations.  Likely what happened is that you installed a version of the TestAddin from a network share or web site (or some other folder) and it was running.  Then, you tried to run it from this bin\debug folder.  Once you did that, you received this error message.

     

    In order to run it from bin\debug, you first must uninstall the version you previously installed (using the Add/Remove Programs (ARP) entry).  Once you uninstall it through ARP, you will be able to run (or install) the version from the bin\debug folder.

     

    For a bit more information, see the "Prompt to Manually Uninstall Appears When You Publish and Install a Solution on the Development Computer" section at http://msdn2.microsoft.com/en-us/library/bb608594.aspx

     

    Likely, what you meant to do was publish it to a UNC share or HTTP web site and install it through setup.exe or double-clicking the .vsto file.  Do that on a separate machine.  Then, from your dev machine, publish updates to the same location.  That separate machine will check for updates based on the settings in your ClickOnce project.  If you want that separate machine to get updates immediately, either run setup.exe again or double-click the .vsto file on that machine.

     

    Hope that helps.

     

    Friday, February 22, 2008 12:14 AM
  • "What this is saying is that there is an add-in, TestAddin, was installed on that machine from a location other than file:///C:/VST03/TestAddin/TestAddin/bin/Debug/TestAddin.vsto"

    That location is my dev build folder. I installed from a web site with the URL, http://localhost/VSTOTest/TestAddin.vsto

    In my Project Properties, Publish Option, I set:

    Publishing Folder Location: C:\Inetpub\wwwroot\VSTOTest\
    Installation Folder URL: http://localhost/VSTOTest/

    I uninstalled/reinstalled and republished and I get the exact same error. I'm not sure what I'm doing wrong.

    • Proposed as answer by phyu Thursday, April 15, 2010 7:37 AM
    Friday, February 22, 2008 2:50 PM
  • hello Evaristo9,

     

    it looks like you are developing and installing on the same computer.  when you build or publish, that is considered the first installation.  when you install from IIS, that's the second installation. this is why you are seeing the error message: the location of each add-in is stored in the registry and checked during the installation. this is a quirk of Office because add-ins have to be registered for each application.

     

    to avoid seeing the error message, there are a few workarounds:

    1. test your deployments from a different user account on your development system.

    2. use a second computer to test the installation and updates.

     

    m.

    Friday, February 22, 2008 5:43 PM
  • Our company has a number of Windows products using VSTO on Office 2007, Office 2010 and Office 2013 on XP, Vista, 7 and 8. Often this error "Deployment.AddInAlreadyInstalledException" leaves me with frustrated; a fresh install is somewhat hard to ask a user for and the problem source is unclear.

    I have gathered our experiences in a blog post on steps to resolve AddInAlreadyInstalledException

    Tuesday, February 12, 2013 12:53 PM