I'm developing add-in using ArcObjects for .NET for ArcMap. Where can I place code on add-in startup and shutdown? Right now I'm using extension within add-in for that purpose. But I want to get rid of extension. Is it possible?
What sort of AddIn are you creating? A button, a toolbar with buttons, a panel...?
Toolbar with buttons. But it doesn't matter. I need to do some actions when add-in starts and finishes. And I want to do these actions without extension.
Have you seen this page, they are wiring up application events within an addin.
In the past I've set the onDemand property to False for a button which forces the addin button to load and you can run code in the onstartup() but this does not deal with shutdown.
I think using application events is wrong way. I need exactly points in time where add-in initialized and uninitialized. I can use extension for that purpose. But it's complexity without any benefits for user (user should remember that turning extension on in Extension dialog is required to use add-in).
Retrieving data ...