Debug new Inventor 2025 add-in

When creating a new add-in you can take advantage of the Visual Studio 2022 templates that are installed as part of the developertools.msi installer found in C:UsersPublicDocumentsAutodeskInventor 2025SDK
More info on it: https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=GUID-52422162-1784-4E8F-B495-CDB7BE9987AB 

Inventor2025Template

You can simply create a folder for your app under C:ProgramDataAutodeskInventor Addins

AddinLocation

and set the Base output path of your project to this in the Project Properties panel so that both the *.addin file and the dll will end up at the right location, i.e. where Inventor can find them.

Outputpath

One more thing to do is set the Copy to Output Directory property of the *.addin file to Copy if newer so it does get copied into the folder we created.

Copyaddin

Usually, when you want to debug your add-in, you want Visual Studio to start up Inventor which will then load your add-in.
In the case of .NET Framework add-ins (like the one for Inventor 2024) that was an option using Start external program:

2024addin
In the case of an Inventor 2025 .NET 8.0 add-in that option is not exposed directly in the Visual Studio UI. What you can do is modify e.g. the Command line arguments of the Launch Profile which will then generate a launchSettings.json file under the Properties folder – just make sure Show All Files option is enabled in the Solution Explorer so that you can see the file.  

LaunchSettingsCreation

Now you can just open the launchSettings.json file and modify the content of the profile so that it’s using the highlighted parts:

{
"profiles": {
"InventorAddIn2025": {
"commandName": "Executable",
"executablePath": "C:\Program Files\Autodesk\Inventor 2025\Bin\Inventor.exe"
}
}
}

Now when you click the Debug button Inventor will start up

InventorStartup

A developer just told me that there is another way to run Inventor when debugging – you just have to create a new Executable profile that allows you to specify the path of an Executable (I also renamed it to Start Inventor to make it clear what it does)

Startinventor

As usual, the first time Inventor encounters your add-in it will block it (unless it’s been signed) and warn you about it, so you just have to go to the Add-In Manager, unblock it and load it

Addinmanager

If you placed a break point inside the Activate method, that should be hit 🥳

Breakpoint


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

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

Continue reading