No separate execution space for the Inventor 2025 add-in

No separate execution space for the Inventor 2025 add-in

HideoYamada
Advisor Advisor
225 Views
2 Replies
Message 1 of 3

No separate execution space for the Inventor 2025 add-in

HideoYamada
Advisor
Advisor

Hello,

 

Inventor 2024 or older provided separate run spaces for each add-ins by .NetFramework function.

Inventor 2025 add-in run space is migrated to Net8 and no separate run space is not provided anymore.

This means that if there are add-ins which uses same named but different version support dll they will conflict.

In other words, the names of all add-in dlls and dlls that are loaded by add-in must be unique.

 

I wish Autodesk will fix this problem soon...

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes
226 Views
2 Replies
Replies (2)
Message 2 of 3

yan.gauthier
Advocate
Advocate

I don't think this is an issue with Inventor but with .Net itself I ran into the same issue with Inventor 2020 with my .NET 6 addin. When trying to run SQLite, the loaded Dll was the one from Inventor So I fixed the SQLite dll from my install folder since Autodesk would use the package that is explicitly mentionned to be use in development only, not in production and then change my NuGet package version to match Inventor's. Honestly, that was the simpler solution. From an execution point of view, the Calling assembly is Inventor.exe.

 

There are a couple solution that direct towards defining your own AssemblyLoadContext class to handle your own version

 

Another one is to use AppDomain.AssemblyResolve event, but that could also backfire.

0 Likes
Message 3 of 3

HideoYamada
Advisor
Advisor

Hi,

 

As you said this problem can be avoided by using the custom AssemblyLoadContext(ALC).

 

I think Inventor.exe should create custom ALCs for each add-ins.

(As Inventor 2024 or older providing an individual application domain for each add-ins.)

 

If the user creates the add-ins and uses them only, the trouble could be avoided.

However, if the user wants to use add-ins created by other add-in creators, this problem cannot be controlled.

 

Because of this, my add-ins at Autodesk AppStore cannot support Inventor2025.

 

=====
Freeradical
 Hideo Yamada
https://www.freeradical.jp
0 Likes