Old add-ins cached in ArcGIS 10.2, preventing updates

13840
11
02-05-2015 02:04 AM
RylandKarlovich
New Contributor

We have recently been updating a custom AddIn for Arc10.2 and would like to understand the reasons behind an issue we are now encountering.

In order to update an add-in, we normally would delete the old version from within ArcGIS and uninstall it from the computer before installing the new version. It would now appear that ArcMap 10.2 however, caches components of the old version in the Assembly Cache such that it is not properly removed when we uninstall the add-in, and when we install the new add-in ArcGIS still references the old files.

Therefore, in order for our updates to take effect we have found that we also need to clear any old add-in content from the Assembly Cache before installing the new add-in. We did not find this to be an issue in previous versions of ArcGIS.

Has anyone else seen this behaviour? We would expect to be able to update add-ins by going through the normal delete/add process and should not have to access the Assembly Cache in the process.

11 Replies
seria
by Esri Contributor
Esri Contributor

After deleting an Add-In from ArcMap (using the Add-In Manager, or directly from the Well-Known folder), you will notice that the Add-In has been deleted from the Well-Known folder located at:

  • C:\Users\\Documents\ArcGIS\AddIns\Desktop10.2\

However, the Addin dll will still persist in the Assembly Cache located at:

  • C:\Users\YourUserName\AppData\Local\ESRI\Desktop10.2\AssemblyCache

To delete the dll from here, you will need to close the current ArcMap Session, start a new session of ArcMap, and then close it again. At that point, the Addin will be deleted from the Assembly Cache. It is upon this second closing of ArcMap that ArcGIS realizes that the Add-in is no longer available in the Well-Known folder.  

MatSavage1
New Contributor III

Sami,

Does the end user need to have any particular permissions to the AssemblyCache folder in order for this process to work? I'm having issues with old versions of the add-ins not being updated when I push new ones to network folders.

0 Kudos
seria
by Esri Contributor
Esri Contributor

Matt,

The end user need not have elevated permissions to the Assembly Cache. If you could provide a detailed list of steps that you are following to "update" your add-ins in your network folder, that would be helpful in tracing the problem.

Please let me know if the steps below are the ones you are following:

Steps to Reproduce:

1- Created Add-in X in Visual Studio 2012.

2- Copied Add-in X to Network Folder

3- Double-clicked it to install it.

4- Add-in X  successfully installed.

5- Started ArcMap 10.2.2 and added Add-in X to a toolbar.

6- Uninstalled Add-in X using the Add-in Manager Dialog box.

7- Created Add-in Y in Visual Studio 2012.

8- Copied Add-in Y to our shared network Folder.

9- Double Clicked Add-in Y to install it.

10- Successfully installed.

11- Opened ArcMap.

12- The Add-in X button was still there in the Toolbar (???). It had not been deleted in step 6 above.

13- Tried to look for Add-in Y in the Customize dialog box (under some component category) but could not find it (???).

If the above steps do not accurately reflect what you are doing, then please copy/paste these into a new message, and Add/remove steps from the list describe what you are doing, step-for-step.

Thanks

Sami

0 Kudos
MatSavage1
New Contributor III

1- Created Add-in X in Visual Studio 2012.

2- Copied Add-in X to Network Folder which has been added as an Add-In folder in the options tab of the Add-in Manager (or alternately as a well-known folder via registry key)

3- Open ArcMap and Add-in X works correctly

4- Modified Add-in X source code in Visual Studio 2012

5- Rebuild Add-in X in Visual Studio 2012 and update version numbers, etc

6- Replaced Add-in in the Network Folder

7- Close ArcMap

8- Open ArcMap and the Toolbar from Add-in X shows fine, but the button doesn't work

9- Check Add-In Manager and version number matches step 4

10- Check AssemblyCache and the dll from from Add-in X has not been updated (old time stamp and dll version number).

11. Manually deleting the dll and closing/reopening ArcMap solves the problem (it loads the dll correctly from the Add-In in the known folder).

0 Kudos
seria
by Esri Contributor
Esri Contributor

Matt,

Thanks for providing the detailed steps.

Please answer the following questions:

1- What version of the ArcObjects SDK was the old Add-in built with? ArcGIS 10.1, for example?

2- Did you uninstall an older version of ArcGIS from your computer, and then install a newer version of ArcGIS? What is the newer version; 10.2.2 or 10.3?

3- So, you built an Add-in with, say Version 10.1, then opened it up on a computer with Version 10.2 or 10.3, correct?

4- Then you re-built it for the new version, after updating the version number in the Config file, and setting the project property, Specific Version, to false. Correct?

5- Before the 'new' Add-in is copied to the Network (Well-Known) folder, does the Assembly Cache contain the OLD Add-in dll? It is not clear how this would have happened considering that a newer version of ArcMap has just been installed on this computer. Please clarify on this.

6- Unless, I am totally misunderstanding the meaning you are attaching to the term "version." Do you mean the Version of ArcGIS or the Version of the Add-in?

Thanks

Sami

0 Kudos
seria
by Esri Contributor
Esri Contributor

After thinking about your post for some time, I think I now understand what you are doing. You  are working in a single version of ArcGIS. The version you are referring to is the version of the Add-in, correct?

I have tested your workflow. Everything works as expected. I am working with ArcGIS 10.3.

Here are the steps I am following:

1- I create a new Add-in.

2- Copy it over to a network Shared Folder

3- Open Add-in Manager in ArcMap, and through the Options tab, set the Well-Known folder

4- The Add-in shows up in the Component Category under the Customize Dialog box as expected. I Am able to add the Addin button to a toolbar in ArcMap and execute it. A message box shows up with some message.

5- Close ArcMap

5- Then in Visual Studio 2012, I make a small change to the Add-in (for example, add a different message box message to simulate an Update to the Add-in).

6- Build the Add-in in Visual Studio.

7- Copy/Paste (replace old Add-in) the newly updated Addin file (*.esriaddinx file from the bin folder) to the Network folder. I make sure I overwrite the old file.

8- Open ArcMap and execute the existing Add-in button on the toolbar

9- The New Updated Message box shows up. This means the Addin was updated.

10- Expected behavior. No need to delete dll from the Assembly Cache to update the Add-in.

I guess, I am not reproducing your issue. What version of ArcGIS are you using?

Thanks

Sami

0 Kudos
MatSavage1
New Contributor III

I'm using 10.2.2.

0 Kudos
seria
by Esri Contributor
Esri Contributor


Matt,

You are right. The workflow I describe in the pre-current post above does not work for ArcGIS 10.2.2. I would consider this a bug with respect to ArcGIS 10.2.2. In fact, the old Add-in does not auto-delete from the Assembly Cache no matter what you do at version 10.2.2. The work flow I proposed at the beginning of this thread (closing and re-opening ArcMap at least twice to delete the dll from the Assembly Cache) does not seem to delete the add-in dll from the Assembly Cache at version 10.2.2. It, however, does work at version 10.3.

Nonetheless, one way to ensure that the Add-in does indeed update in ArcMap 10.2.2 without having to navigate to the Assembly Cache to delete the old Add-in is for you to first delete the old Add-in from the Well-Known folder (your network Share folder). Once it is deleted from the Well-Known folder, start ArcMap and ensure that the Old Add-in is indeed gone, meaning, you do not have access to the button in Customize mode any more -- it does not show up in the Component Category. After ensuring that it is gone from ArcMap, copy/paste the NEW updated Add-in (the *.esriAddinx file)  into the Well-Known folder (the network Share folder). If you open ArcMap and try to use this new Add-in button, you will indeed see the updated Add-in behavior. This is the only work around I can think of that would eliminate the need for you to have to access your Assembly Cache to delete an Old Add-in.

I hope this helps.

MatSavage1
New Contributor III

Thank you for looking into this and verifying it for me, Sami. I'm happy to hear that it will not be a problem at 10.3!

-Mat