Reload (debug) custom Add-In without Inventor restart

Reload (debug) custom Add-In without Inventor restart

Maxim-CADman77
Advisor Advisor
2,446 Views
18 Replies
Message 1 of 19

Reload (debug) custom Add-In without Inventor restart

Maxim-CADman77
Advisor
Advisor

Some time ago I tried myself as AddIn developer for Revit.

Revit is definitely not my favorite Adsk software but there is one thing I wish be present for Inventor.

It is about possibility to reload addin on-the-go (without restarting Revit) for debugging purposes.

More details in articles:

 - AddInManager 

 - Reload Add-In for Debug Without Restart 

 - Debugging an Add-In without Restarting Revit 

I'd like to know whether "on-the-go" reload of Add-In is possible for Inventor?

Please vote for Inventor-Idea Text Search within Option Names

2,447 Views
18 Replies
Replies (18)
Message 2 of 19

Frederick_Law
Mentor
Mentor

Try unload the addin in Inventor, replace the files, reload the addin.

0 Likes
Message 3 of 19

Maxim-CADman77
Advisor
Advisor

Seems like Inventor don't really release dll of AddIn that was loaded to current release and then "unloaded" ("The file is in use by Autodesk Inventor" on attempt to delete the dll).
I wish Inventor behave the same as Revit.
Maybe it worth to register the Idea at IdeaStation or, maybe, there is such one already?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 19

Frederick_Law
Mentor
Mentor

Just tested.  2023.

I can rename the dll while it is loaded.

 

Test another one with event handler.  I can rename that too.

 

So your addin is still running?

0 Likes
Message 5 of 19

Michael.Navara
Advisor
Advisor

This  behavior is really bothering and it consumes a lot of time during development process. Several years ago I created the tool for it for our team. But it is for internal use only.

 

But the concept is similar to my iLogic for VisualStudio tool. You can load multiple versions of the same DLL to single process (AppDomain), but they must have different versions. Then you can instantiate objects and call methods on them and this is the way, how you can mimic the reload of the add-in.

 

Maybe in future I will create updated version for public use.

If you found this tool helpful, please give a LIKE. If there will be more than 10 likes, I promis the public version.😀

Message 6 of 19

Maxim-CADman77
Advisor
Advisor

Wow, 10 Likes per day!

MaximCADman77_0-1722601277108.png


Update:
..already "more than 10 Likes"

Please vote for Inventor-Idea Text Search within Option Names

Message 7 of 19

Michael.Navara
Advisor
Advisor

OK This looks like a challenge. I'm working on it and I will notify you about progres.😀

Message 8 of 19

JelteDeJong
Mentor
Mentor

Most of the time I make a separate application within my solution. With that application, I just start/call the part of the addin that I want to debug, without restarting Inventor. I wrote a blog post about this.

Debugging without restarting Inventor

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 9 of 19

Michael.Navara
Advisor
Advisor

As I promised, the initial release of public version of Inventor AddIn debugger  is available. 

See the GitHub page

Message 10 of 19

Maxim-CADman77
Advisor
Advisor

It can't load any of my addins

I press "Activate" then "NET 4.8" and point to my DLL

It then shows MsgBox "Failed"

... and then MsgBox "There is no add-ins in this assembly".

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 11 of 19

Michael.Navara
Advisor
Advisor
0 Likes
Message 12 of 19

Maxim-CADman77
Advisor
Advisor

From your samples?
Do you mean to compile any project from https://github.com/CSmichaelnavara?tab=repositories ?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 13 of 19

Michael.Navara
Advisor
Advisor

Ooops! There was a bug in loading add-ins. 

Sample addins was added as downloadable zip package to release

Fixed release was published.

0 Likes
Message 14 of 19

Maxim-CADman77
Advisor
Advisor

I can confirm - v 1.0.1 does see your Sample AddIn when pointed to <location of unarchived SampleAddIn.zip>\SampleAddIn\2025\SampleAddInModuleNet8\bin\Debug\net8.0\SampleAddIn.dll

 

But it still fails with other AddIns,
ex. after install of ViewReference

and pointing to "C:\ProgramData\Autodesk\ApplicationPlugins\iAutomate Design View Reference.bundle\Contents\ViewReference.dll" (either "NET 4.8" or "NET 8")
it again shows two consequent MsgBoxes "Failed" and "There is no Addins in this assembly".

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 15 of 19

Michael.Navara
Advisor
Advisor

😀Fu..ing users!😀

There was an issue in passing arguments to external process.

Try the next release

0 Likes
Message 16 of 19

Maxim-CADman77
Advisor
Advisor

Seems like NET 4.8 AddIns is OK to reload
Unfortunately I'm already in the half-way to migrating one of my AddIns to NET 8 and it fails with this msg:

MaximCADman77_0-1723457445241.png

 

The AddIn itself can be loaded and works more or less as expected.
Any Ideas?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 17 of 19

Michael.Navara
Advisor
Advisor

It looks like a reflection hell in .NET8. 

Try to fill settings manually (Assembly file and AddIn CilentId). I will continue to look for solution.

0 Likes
Message 18 of 19

Michael.Navara
Advisor
Advisor

New release was published.

Main change is the ability to load settings information from .addin file instead of compiled DLL file.

 

Message 19 of 19

gerald_engineers
Participant
Participant

I think this topic should really be something Autodesk should improve. The feedback loop is to long when restarting Inventor is needed.
I could not find an issue in the "Inventor Ideas" forum.


Did I miss something?
Shouldn't that be a thing which would get many upvotes?

And: Thanks to @Michael.Navara and @JelteDeJong for your solutions. At the moment I am trying the solution from Jelte because I got an error (being on Inventor 2024) with Michaels solution. But I might look into it again and create a issue in the github repo.

0 Likes