Addins problem

1068
9
10-06-2011 10:53 AM
FaizanTayyab
Occasional Contributor
I have two machine both 64 bit with win xp. I installed ArcGIS Desktop 10 on both which works fine. I have also created an addin which has few buttons and menus.

After installing the addin on both machines, i can see the toolbar on both the machines but the toolbar only works on one machine and does not on the other. On the problem machine, clicking a button just disables the button and the button does nothing and no error is returned, whereas on the other machine it works fine.

Has anyone experienced something similar.

Thanks
0 Kudos
9 Replies
JeffreyHamblin
New Contributor III
One thing to check: If you are using Visual Studio 2010, you need to set the platform for your project to "x86" -- not "Any CPU."
0 Kudos
FaizanTayyab
Occasional Contributor
Thanks jeff, I will give it a go. Can please explain as to why the platform needs to be x86?
0 Kudos
JeffreyHamblin
New Contributor III
ArcGIS is a 32-bit process, and you want to ensure your Add-in is 32-bit (x86) even when run on a 64-bit OS. And my understanding is that the "Any CPU" setting gives the .net JIT compiler some leeway on what it outputs depending on the host OS.

I'm not sure that this is your problem, but it is the first thing I would check. The problem you describe happens when ArcGIS cannot load the Add-in assembly even though it can read the config.esriaddinx and create toolbars and buttons.
0 Kudos
FaizanTayyab
Occasional Contributor
ArcGIS is a 32-bit process, and you want to ensure your Add-in is 32-bit (x86) even when run on a 64-bit OS. And my understanding is that the "Any CPU" setting gives the .net JIT compiler some leeway on what it outputs depending on the host OS.

I'm not sure that this is your problem, but it is the first thing I would check. The problem you describe happens when ArcGIS cannot load the Add-in assembly even though it can read the config.esriaddinx and create toolbars and buttons.


You are right, that is what is happening. I can see the toolbar but its not loaded. However i am surprised as to why it is happening on one machine and not the other. I have checked different things including registry entries and everything is same on both the machines. I will check the Any CPU setting.
0 Kudos
FaizanTayyab
Occasional Contributor
Tried building against x86, didnt solve the issue. I am still getting the toolbar showing up but not actually loading.

Any other suggestions I can try.

Thanks
0 Kudos
JeffreyHamblin
New Contributor III
Have a look at these two forum threads:

Add-in-Failure-to-get-code-to-execute-when-toolbar-button-pressed

Cannot-load-form-or-even-display-a-message-box

Make sure the namespace in your code matches the one in the Config.esriaddinx file.

If none of that helps, maybe there is an issue with XP 64-bit. Does the ESRI MapCenter Add-In that is installed with ArcGIS 10.0 work? Select the ArcGIS Online... item on ArcMap's File menu to test it.
0 Kudos
FaizanTayyab
Occasional Contributor
Have a look at these two forum threads:

Add-in-Failure-to-get-code-to-execute-when-toolbar-button-pressed

Cannot-load-form-or-even-display-a-message-box

Make sure the namespace in your code matches the one in the Config.esriaddinx file.

If none of that helps, maybe there is an issue with XP 64-bit. Does the ESRI MapCenter Add-In that is installed with ArcGIS 10.0 work? Select the ArcGIS Online... item on ArcMap's File menu to test it.



Thanks for providing the links. I will investigate further.
0 Kudos
FaizanTayyab
Occasional Contributor
I have tried the suggestions in the links provided but still i am having problems on some machines. I think i might have established a pattern. We have two kind of machine, old dell ones and new HP ones. I am having no problems with the old dell mahines but am having with new HP machines.

Although on all machines, the installtion process is same yet still the addin doesn't work. On top of the the ArcGIS Online addin also doesnt work, so i wouldnt say its a problem with my custom addin.

It might be a operating system thing but on all machines we have WinXP 64 bit.

Any other suggestion.

Thanks
0 Kudos
JeffreyHamblin
New Contributor III
Interesting.

Add-ins run from the ArcGIS Assembly cache. The DLL and any data included with the Add-in are copied there from the .esriaddin container (which is a ZIP file). However, the Add-in config is not copied there -- apparently loaded directly from the container. So if something is not correct with the cache, ArcGIS will still create the buttons and toolbars based on the config XML, but won't be able to run their code.

Try checking that the cache has been created correctly, and that the permissions on the folders and Add-in files you find there are correct.

On Win7/Vista, the cache is located at:
C:\Users\[username]\AppData\Local\ESRI\Desktop10.0\AssemblyCache

The AssemblyCache folder is a hidden folder.

On XP, it will be under Documents and Settings instead of Users with a similar path such as:
C:\Documents and Settings\[username]\Application Data\ESRI\Desktop10.0\AssemblyCache
0 Kudos