Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Conditional .addin statement

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
DelightfulCurmudgeon
223 Views, 5 Replies

Conditional .addin statement

Is it possible to direct Inventor to a different addin library file depending on what version of Inventor is running?
I want to have my add-in support both 2025 and pre2025 which requires being built to both .net8.0 and .net4.8. However, I can't figure out how to direct Inventor to load the proper file.

The internet says I can have something like this:
<Assembly Condition="'$(TargetFramework)' == 'net8.0'">Addin.dll</Assembly>
<Assembly Condition="'$(TargetFramework)' == 'net4.8'">net4.8\Addin.dll</Assembly>

But regardless of what framework I target, it loads 4.8 first. If I remove the .dll fromthe 4.8 directory then it resorts to the other location. I tried having similar conditional statements that look for the version of Inventor but i get similar results.

Has anyone been able to resolve this issue?

5 REPLIES 5
Message 2 of 6

Not sure.

I use different solution for different IV version.

It'll build into different folders and IV will pick the correct one to use.

I used to have 3-4 version installed.  One is latest to test features and addin.

Addin-02.jpg

Addin-03.jpg

 

Hmmm I should rename VS build folder to match IV addin folder name.

Message 3 of 6

How does this work with deploying?
Do you have an .addin file for each version? 

I'd like to keep it as simple as possible as it is deployed to the add-in store and I don't think they permit that sort of folder structure (i'll have to check if it happens to be the only solution)

Message 4 of 6

I added screenshot of deployed folder.

Yes, each need it's own folder and .addin file.

 

Detail here:

https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-52422162-1784-4E8F-B495-CDB7BE9987AB

Addin-04.jpg

Message 5 of 6

You can specify which addin library is used for which Inventor version using 

SupportedSoftwareVersion... value. But as @Frederick_Law mentions above, you need to deploy complete set of binaries with appropriate .addin file for each Inventor version.
 
Second option is to deploy your addin to version specific folders.
 
Third option is to check if your addin build for .NET 4.8 works with Inventor 2025 (.NET 8). Sometimes it requires just minimal code update and the addin can work. For example Vault client addin for Inventor 2025 is compiled for .NET 4.8
Message 6 of 6

Thanks for this.
I was able to get one of them up and running by not compiling it in net8.0 as it was compatible with minimal modifications. However, to debug I had to compile it to net8.0, but once everything was running simply deploying a 4.8 seemed to function without issue.

I'll be going through the rest of my addins to see if I can use this method.
I guess time will tell if it will cause problems 2026+ but at the moment it seems to be a  fix.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report