Add-in testing

Add-in testing

mat_hijs
Collaborator Collaborator
533 Views
9 Replies
Message 1 of 10

Add-in testing

mat_hijs
Collaborator
Collaborator

When working with an add-in, what would be the best way to test it? At the moment I move the existing dll to another folder and replace it with my new dll that I want to test. I test it and then delete the old dll if everything works or put the old dll back if there's still problems. I can't imagine this is the best way to deal with this. Especially because I moved the location for the dll to a central location so multiple people can use it. I don't want to mess with a dll that other people may be using at that moment.

Basically I'd like to know if it's possible to somehow keep the old dll in place while I test in a separate environment.

0 Likes
Accepted solutions (2)
534 Views
9 Replies
Replies (9)
Message 2 of 10

Michael.Navara
Advisor
Advisor
Accepted solution

For debugging Inventor add-ins I create and use this tool which is free and in my opinion very handy.

https://github.com/CSmichaelnavara/InventorAddInDebugger

 

Message 3 of 10

pball
Mentor
Mentor
Accepted solution

The setup I use is every user has the addin installed locally and I have my Visual Studio setup to auto move the DLL file on build to the proper location on my PC. So I'll generally be running a beta version for testing while everyone else is running the release version.

If you have a central location for everyone, you could change your setup to use a local copy of the DLL and leave everyone else using the central version. This way you could do testing without affecting others.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 4 of 10

mat_hijs
Collaborator
Collaborator

@Michael.Navara Although that does look handy I think that's a bit above my head.

 

@pball Your setup probably makes the most sense especially when updates are sporadic. However I'm constantly updating, fixing bugs, adding features, ... often multiple times per month and I don't want to bother the other users to replace the dll every time I make a change. Keeping the production dll in a central location and using a local dll when testing is probably the best way forward for me. Thanks!

0 Likes
Message 5 of 10

Michael.Navara
Advisor
Advisor

OK @mat_hijs 

If you want to test your add-in, you don't need to move original .dll file. You can modify the path to the .dll in .addin file. You can comment out the original <Assembly> node and create your own with full path to your build directory. See the lines 9 and 10 in sample .addin file. Later on you can switch between dev and production version only in this file.

 

<?xml version="1.0" encoding="utf-8"?>

<!-- Type attribute is same as Type registry key (Standard, Translator, Plugin (Server only) -->
<Addin Type="Standard">
  <ClassId> {00000000-YOUR-GUID-HERE-000000000000}</ClassId>
  <ClientId>{00000000-YOUR-GUID-HERE-000000000000}</ClientId>
  <DisplayName>My Addin</DisplayName>
  <Description>This is my addin.</Description>
  <!-- <Assembly>MyAddIn.dll</Assembly> -->
  <Assembly>C:\Full\Path\To\MyAddIn.dll</Assembly>
  <SupportedSoftwareVersionGreaterThan>21..</SupportedSoftwareVersionGreaterThan>
  <LoadAutomatically>1</LoadAutomatically>
  <LoadBehavior>0</LoadBehavior>
  <UserUnloadable>1</UserUnloadable>
  <Hidden>0</Hidden>
</Addin>

 

But you can't rebuild your addin when Inventor is running and your addin is loaded.

0 Likes
Message 6 of 10

mat_hijs
Collaborator
Collaborator

I was already aware of this, thank you.

0 Likes
Message 7 of 10

mslosar
Advisor
Advisor

I do something similar, so i'm always running the test version as well.

 

For the released version, everyone has it on their machine. However, we have a standalone application people can update the addin with (it takes maybe 15 seconds). The addin has a check in it and when the add in loads, it checks the version of the file on the server, if the local version is older, they get a nag screen telling them to update. They don't have to update, but the nag screen does its job admirably. Everyone updates so as not to see the nag screen 🙂

Message 8 of 10

mat_hijs
Collaborator
Collaborator

That seems like a good way, but again way over my head. It may also be a bit overkill in my situation as we only have a couple of users.

0 Likes
Message 9 of 10

mslosar
Advisor
Advisor

In my experience, doesn't matter if you have 4 or 400 users. It's nearly impossible to get everyone to update to the current version on their own. Short of turning it over to IT to do a mass push (which at least here, takes WAY too long - especially for a small fix), I found the nag screen works beautifully. No one can claim they didn't know. Anyone out of date is out of date willfully and they know it. Makes some conversations really really short. "This isn't working"..."Are you on the latest version?"..."Uh..let me check and i'll get back to you", and that's typically it because they know they didn't update 🙂

0 Likes
Message 10 of 10

pball
Mentor
Mentor

If you want to be mean like me, you could have the addin check a central location for a new version, give a popup saying there is a new version, and then unload itself. At least one person has posted a method on the forum for a self updating addin, but I haven't had the time to dive down that rabbit hole.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes