Hi Jeremy,
Thanks for the response.
I tried you're addin, these work as expected. But a IExternalCommand loads another IExternalCommand.
In my situation a IExternalApplication loads another IExternalApplication (not same assembly or id's).
Now for the tests:
1. Removed the loading of RevitAddin2.addin to my actual applicication addin
-> this works, the application only loads once, so far so good
2. Changed the RevitAddin1 into a IExternalApplication, and let it load RevitAddin2.addin
-> this works, the button for RevitAddin2 IExternalCommand is shown at startup.
3. Changed the RevitAddin2 also into a IExternalApplication, with a popup message.
-> this loads twice.
I think this is a Bug or just a limitation for the LoadAddIn method, loading a IExternalApplication from another IExternalApplication will cause the loading IExternalApplication to be called twice.
Same result with LoadPackageContents method
IExternalCommand -> IExternalCommand (ok)
IExternalCommand -> IExternalApplication (ok)
IExternalApplication -> IExternalCommand (ok)
IExternalApplication -> IExternalApplication (loads twice)
All tested in R2018, this behaviour existed already in R2014
Any further thoughts or idea?
I can set a EnvironmentVariable on first load to check against, and if already set stop executing the rest of the code in IExternalApplication.OnStartup preventing the creation of duplicate Ribbontabs/panels.
(don't know if this creates other problems...)
Or just stick with manual update of addin.
Ps. I'm using R2015-R2019 (R2020 still to do)
My addin also doesn't use ApplicationInitialized or so, it can be loaded mid-session even with documents already open. All per-document variables are created as needed.
Best regards,
Michel