2

I'm in the process of learning how to create add-ins for Microsoft Office Word. I've created a simple Word 2010 Add-In project in Visual Studio 2010 which displays "Hello World" in a message box. Up to this point everything works fine. But if I want to change the message for instance from "Hello World" to "Hi" i get the following error message

System.Deployment.Application.DeploymentException: Unable to install this application because an application with the same identity is already installed. To install this application, either modify the manifest version for this application or uninstall the preexisting application.

After installing the add-in I do the following:

  1. Remove the add-in from Ms Word Options,Add-Ins
  2. Uninstall the add-in from Add Remove Programs
  3. Delete the Normal.dot file
  4. Delete the .vsto in my bin/Debug folder of the project

Once I re-run the project I get the error above. I really don't know where else can this plug in exist as I think I delete all possible places where any references to it could be found.

I've also tried running RegScanner and deleting all the registry entries pertaining to the add in,yet im getting the same error...

If anyone had this issue before and you know exactly how to solve it and what could be causing it please let me know!

Kara
  • 6,115
  • 16
  • 50
  • 57
Denys Wessels
  • 16,829
  • 14
  • 80
  • 120
  • there might be something left behaind in the GAC... – Yahia Nov 17 '11 at 10:38
  • Hello Yahia, nothing in the GAC the add-ins are vsto files and as far as I know they don't get placed in the GAC – Denys Wessels Nov 17 '11 at 13:14
  • What happens if you create a completely new project - does that install ? – Yahia Nov 17 '11 at 13:20
  • Yes once i create a new add in it works perfectly.The thing is i need to know how to update an existing add in.If the customer for instance need's something to be updated we simply send the new vsto file and they install it.When i change code in the existing add-in and re-run the project the changes are not displayed and if i delete all the things mentioned in my initial post and try re-run the project i get the aforementioned error.I've been trying different things for days but can't get this working...sigh – Denys Wessels Nov 18 '11 at 05:17
  • What happens when you update the freshly created one ? – Yahia Nov 18 '11 at 09:17
  • I get the error mentioned in my question – Denys Wessels Nov 18 '11 at 09:41

1 Answers1

2

I discovered that if you modify any code in a MS Word Add-in in Visual Studio and you want your changes to be updated in MS Word you can do the folowing:

In Visual Studio,change the version number in Project Name\Properties\Publish\Publish Properties.

Once the version number has been changed (e.g 1 0 0 1) rebuild the project in Visual Studio.

Navigate to ProjectFolder\bin\Debug and double click the .vsto file, voila! You get the following message - The Microsoft Office customization was successfully updated.If you view the .vsto file with a text editor you can also see that the version number has been changed to a new value,hence an update occurs when you double click the .vsto file.It picks up a new version number and re-installs the add-in and successfully attaches to Word.

If the above is the accepted way to do it, that's fine, but I would still like to know whether there is any way that an add-in can be automatically updated in Word without changing the version number.Simply change code,rebuild project,install.

Denys Wessels
  • 16,829
  • 14
  • 80
  • 120