views:

288

answers:

2

For testing purposes I need to get my Outlook 2003 addin (vb.net) disabled so that it can only be reactivated through the help menu or by deleting the resilency key from within the registry.

I tried to achieve this by creating an unhandled invalid cast exception during the startup eventhandler but this does not help. Outlook only says that it could not load the addin but it does not disable it.

How can I create a crash which does disable the addin?

+2  A: 

I found a simple way by myself:

  • Set a breakpoint within the startup eventhandler of the addin.
  • Start the addin from within the visual studio in debug mode.
  • As the breakpoint is reached open the Taskmanager.
  • Kill the Outlook process.
  • Start Outlook normaly (not from the Visual Studio).

-> Outlook will now ask you whether you want to disable the addin or not.

Marcus
A: 

Hi,

Another operation can be during startup call something like

System.Threading.Thread.Sleep(10000)

during this kill outlook from the task manager.

When you start outlook next time, it will ask you if you want to disable the addin.