Keep those troublesome Add-ins from loading


If you have written more than the basic hello world Add-in, you probably have run into problem where you wrote some bad code (hey, it happens to everyone) and the Add-in was set to load on startup. Then, when you start VS, the bad code (such as using a null pointer in C++ code) runs and then VS will crash. To help with this problem, VS has code that allows you to not run Add-ins on startup but it is not well documented.


 


Then you start VS, if you were to hold down the shift key, VS will not automatically load any Add-ins. They will still run if an Add-in had created any UI (such as a command bar button) and the user clicks that UI, or if you manually load them from the Add-in manager dialog box, but they will not load on startup. This technique is also useful for developing Add-ins. Suppose you create a new Add-in and set it to load on startup, if you were to close VS then restart to work on your Add-in, you will not be able to build because the DLL will be loaded into memory. Simply hold down the shift key when starting the instance of VS that you will be developing in, and you can build as necessary.


Comments (2)

  1. Aaugggh!!!!!!

    Not well documented! I wish I had this little tip for the past year and a half! We have been using an add-in to supply the fancier features of the command bar for VG.net (avoiding a package). What a pain it has been to start, uncheck the boxes under add-ins, and restart everytime, simply because VS registers the add-in on build.

    Now, what you really need, is a way to avoid locking the dll in the first place.