Cannot load or reload add-in

By Adam Nagy

If you have issues with loading or reloading your add-in these might be the most likely issues. 

1) Issues with loading the add-in

This is the scenario when your add-in never gets loaded. 

Is your add-in found by Inventor?
– if your add-in is not listed in the Add-In Manager dialog then Inventor cannot even find your add-in. You should check that you placed your *.addin file in the right folder and that all the information in it is correct: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=20143212

Addinloading

Does your add-in have a unique id?
– maybe your add-in was based on an existing add-in and so is using the same GUID as another one which gets loaded into Inventor. You can always list all the add-in GUIDs which are being loaded into Inventor and compare that to your add-in's GUID.    

Guid

Is the bitness of your add-in the same as Inventor's?
– check the project setting that it's 32 bit on a 32 bit OS and 64 bit on a 64 bit OS. In case of a .NET add-in the easiest is to use the "Any CPU" setting

Bitness

Is your add-in COM Visible?
– make sure that "Make assembly COM-Visible" setting is checked. Note: do not confuse it with the "Register for COM interop" setting which should be switched off as that would make the add-in use the old registration mechanism.

Comvisible

Still cannot load it?
– if you still cannot even step into the code inside the Activate() method then you might have some unresolved dependencies or you might have some issues inside the constructor of your ApplicationAddInServer implementation or maybe some global variables that error out. If there are any issues before reaching the Activate() method or inside that, your add-in will not get loaded. 

2) Issues with reloading add-in

This is the scenario when you could already load your add-in successfully, but within the same Inventor session, once you unloaded your add-in you could not get it loaded again.

Are you removing the controls you are creating?
– the most likely problem is that you are creating some control definitions and UI components, but you do not remove them inside the Deactivate() method when your add-in gets unloaded. So when you try to load your add-in again, since those components already exist, your code will error out and the loading of the add-in will be cancelled.   


Comments

4 responses to “Cannot load or reload add-in”

  1. Pls help.
    I have some problem with this load and unload things.
    My addin load and code on Activate() method works fine, but when i move to addins manager my addin is unchecked (unloaded), i can load it again (and Activate works again), but after this addin just unloaded again. Also Deactivate () method doesn’t triggered in all this steps. I just want that my addin works in background and triggered on srecified events, but this unload things is realy a problem for accomplish this.

  2. Hi,
    In that case something in your Activate method is causing problems. You should debug through that code to find the issue.
    If you are still having problems after that then you would need to narrow down your project to something that you could share with us so we could reproduce the problem on our side, then log it on the forum.
    Cheers,
    Adam

  3. Hi, Adam.
    Thanks for reply.
    Ok i’m try something, i’m change my target .net frmwrk from 3.5 to 4.5.2. And in this case this code gave me error.
    private Inventor.DocumentEventsClass drwEvent;
    on Activate () method
    drwEvent.OnNewView + = new IRxDocumentEvents_OnNewViewEventHandler (AddLabelToView);
    After i comment this code load addins worked fine, there wasnt unloaded issues.
    But i dont know how can i get event method in inventor object model to get event on drawings that triggered when created a new drawing view. I only find this DocumentEventsClass.OnNewView but its dont work.
    program language: C#
    Inventor 2014
    IDE: Microsoft Visual Studio 2015

  4. Hi everybody,
    Thanks for this blog guys, lots of very useful stuffs.
    My AddIn also not get automatically load when the reference “Autodesk.Inventor.Interop” is not copied to local…
    Not sure is a “proper” way, but it works for me
    Cheers
    Saloum

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading