Custom addin - dll location question

Custom addin - dll location question

mslosar
Advisor Advisor
360 Views
2 Replies
Message 1 of 3

Custom addin - dll location question

mslosar
Advisor
Advisor

All the samples and most discussion seems to be that you reference the dlls from their installed location, i.e., C:\ProgramData\Autodesk\ApplicationPlugins\VaultInventor2023.bundle.  

 

Is there any pro/con argument for copying the used dlls from these locations to the visual studio project itself in a dll folder or something so that people without the applications installed can pull/build the code?

 

I recall having run into an issue where having the inventor.interop file installed with the addin as opposed to simply referenced kept a command from running. It didn't not throw errors, it just didnt' work. The solution, as pointed out on this site was to not publish the dll with the addin and that worked.

 

Just wondering what people's positions are on doing something like this.

0 Likes
361 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor

For an addin to work, the location of the *.addin file is important. It needs to be in one of these locations.

  • All Users, Version Independent
    • %ALLUSERSPROFILE%\Autodesk\Inventor Addins\
  • All Users, Version Dependent
    • %PROGRAMFILES%\Autodesk\Inventor 20xx\Bin\Addins\
      • Before Inventor 2024 this used to be %ALLUSERSPROFILE%\Autodesk\Inventor 20xx\Addins\ folder)
      • I noticed that you need local admin rights on your computer to write to this folder. If you don't have those "rights" then Visual Studio will stop the building process when you try to debug your addin!
  • Per User, Version Dependent
    • %APPDATA%\Autodesk\Inventor 20xx\Addins\
  • Per User, Version Independent
    • %APPDATA%\Autodesk\ApplicationPlugins

(This info comes from my addin tutorial about Inventor 2025 but should work also for older versions.)

In the  *.addin file you can tell Inventor where to look for the *.dll file. That can be where you like. Your *.dll file might look like this:

<Addin Type="Standard">
	<ClassId>{[Your GUID here]}</ClassId>
	<ClientId>{[Your GUID here]}</ClientId>
	<DisplayName>[Name]</DisplayName>
	<Description>[Description]</Description>
	<Assembly>c:\path\to\your\addin.dll</Assembly>	
	<SupportedSoftwareVersionGreaterThan>??..</SupportedSoftwareVersionGreaterThan>
</Addin>

 

 

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 3 of 3

mslosar
Advisor
Advisor

Not those file. I'm talking about things like Autodesk.Inventor.Interop, Autodesk.Connectivity.WebServices, things like that.

 

Per the SDK examples and most stuff i've seen here, the policy has been to refer to them where they're located - as in : C:\ProgramData\Autodesk\ApplicationPlugins\VaultInventor2023.bundle\Contents\Autodesk.Connectivity.WebServices.dll.  And, to not have them Copy Local as part of compiling the addin. 

 

Our IT group has asked us to find all the references we're using, make a folder in Visual Studio, drop the dlls there and point the code to those files and set them to Copy Local so they're distributed as part of the add in.

 

The question is, is that acceptable for Inventor/Vault addins?

 

I know i've run into an issue in the past where something failed to work when i had the interop copied local and the solution was to not do that. I do not recall what it was though, so i can't simply test to find out if it still holds true. I have found a recent (ish) post where this type of error applied to open dialog and the solution was to not copy local.

 

More curious if anyone else is doing this or not, or if it's Autodesk's policy not to do this.

0 Likes