Why is it so hard to build add-ins?
Why do have have so much trouble plugging addins into applications?
...and how many different models do we support? Let me count the ways...
1. Unmanaged COM (IDTExtensibility2) add-ins.
2. Managed COM add-ins, registered against MSCorEE.dll.
3. Managed COM add-ins, registered via an unmanaged shim.
4. Unmanaged Excel automation add-ins that implement IDTExtensibility2.
5. Unmanaged Excel automation add-ins that don’t implement IDTExtensibility2.
6. Managed Excel automation add-ins, that implement IDTExtensibility2, registered against MSCorEE.dll.
7. Managed Excel automation add-ins, that don’t implement IDTExtensibility2, registered against MSCorEE.dll.
8. Managed Excel automation add-ins, that implement IDTExtensibility2, registered via an unmanaged shim.
9. Managed Excel automation add-ins, that don’t implement IDTExtensibility2, registered via an unmanaged shim.
10. Unmanaged ISmartTagRecognizer DLLs.
11. Unmanaged ISmartTagAction DLLs.
12. Unmanaged ISmartTagRecognizer + ISmartTagAction DLLs.
13. Unmanaged ISmartTagRecognizer2 DLLs.
14. Unmanaged ISmartTagAction2 DLLs.
15. Unmanaged ISmartTagRecognizer2 + ISmartTagAction2 DLLs.
16. MOSTL Smart Tags.
17. Managed ISmartTagRecognizer DLLs, registered against MSCorEE.dll.
18. Managed ISmartTagAction DLLs, registered against MSCorEE.dll.
19. Managed ISmartTagRecognizer + ISmartTagAction DLLs, registered against MSCorEE.dll.
20. Managed ISmartTagRecognizer2 DLLs, registered against MSCorEE.dll.
21. Managed ISmartTagAction2 DLLs, registered against MSCorEE.dll.
22. Managed ISmartTagRecognizer2 + ISmartTagAction2 DLLs, registered against MSCorEE.dll.
23. Managed ISmartTagRecognizer DLLs, registered via an unmanaged shim.
24. Managed ISmartTagAction DLLs, registered via an unmanaged shim.
25. Managed ISmartTagRecognizer + ISmartTagAction DLLs, registered via an unmanaged shim.
26. Managed ISmartTagRecognizer2 DLLs, registered via an unmanaged shim.
27. Managed ISmartTagAction2 DLLs, registered via an unmanaged shim.
28. Managed ISmartTagRecognizer2 + ISmartTagAction2 DLLs, registered via an unmanaged shim.
29. Managed ISmartTagRecognizer DLLs, loaded via OTKLoadr.
30. Managed ISmartTagAction DLLs, loaded via OTKLoadr.
31. Managed ISmartTagRecognizer + ISmartTagAction DLLs, loaded via OTKLoadr.
32. Managed ISmartTagRecognizer2 DLLs, loaded via OTKLoadr.
33. Managed ISmartTagAction2 DLLs, loaded via OTKLoadr.
34. Managed ISmartTagRecognizer2 + ISmartTagAction2 DLLs, loaded via OTKLoadr.
35. Unmanaged Smart Documents.
36. Managed Smart Documents, hand-crafted, loaded via OTKLoadr.
37. Managed Smart Documents, using Vertigo SmartDoc Wrapper, loaded via OTKLoadr.
38. MOSTL Smart Documents.
39. VSTO 2003 codebehind customizations, loaded via OTKLoadr.
40. VSTO 2005 codebehind customizations, loaded via VSTOLoader.
Have I stretched the permutations a bit here? Well, these are all different models either from a developer’s perspective, a user’s perspective, an administrator’s perspective, or all three. Plus, I haven’t considered permutations of security model – Office macro security, .NET strong-naming, authenticode. I also haven’t considered the permutations of say a combined Smart Tag plus Smart Doc solution, or VSTO + Smart Tags, or add-ins + Smart Doc, etc. Or permutations involving part of the solution built with VBA in the document/workbook…
If you’re a global enterprise and want to deploy one of these solutions to all your desks, then each permutation is very definitely different. Each deployment packaging process might cost $5,000-$10,000 dollars. You might have to build separate packages for different operating systems, different versions of Office, different user/roles, different localizations. You might have to built separate packages for combined solutions (so division A gets a combined 8, 31 and 39, while division B gets a combined 8, 31, and 37).
…and we’re still restricting our discussion to Office hosts. What about all the other non-Office (and non-Microsoft) applications that support add-ins/plug-ins/customizations?
Have you ever tried building an IDTExtensibility2 add-in for say Visual Studio, or Project? Was it fun? Did you have to reinstall the whole app after you’d broken it? Or, did you ever build an add-in for both Outlook and Excel and then wonder why it behaved differently in the two hosts? Does anybody ever put any code in OnConnection apart from the conditional call to OnStartupComplete? (equally, does anybody ever put any code in OnDisconnection apart from the conditional call to OnBeginShutdown)? Does anybody ever do anything meaningful with any of the parameters to any of the IDTExtensibility2 methods, apart from the application object?
Compare all that with the VSTO 2003 model, where there are just 2 methods: _Startup and _Shutdown. In _Startup, you’re given the application and workbook/document objects, and there’s no ambiguity about what sorts of things you should do in these methods. The VSTO 2005 model is even better, because the corresponding XXX_Startup and XXX_Shutdown methods have exactly the same syntax as any other standard .NET event handler. In addition, the VSTO model is strongly typed, while the old IDTExtensibility2 model is not. Consider that in IDTExtensibility2::OnConnection you’re passed a generic object that represents the host application. In the VSTO 2003 model, you’re given a strongly typed Excel.Application or Word.Application object (as well as a strongly typed Excel.Workbook or Word.Document object). The VSTO 2005 model takes this even further, because the wizard-generated code gives you a class that itself derives from Microsoft.Office.Tools.Excel.Workbook or Microsoft.Office.Tools.Word.Document.
As of right now, VSTO customizations are only supported in Excel, Word and InfoPath. Wouldn’t it be nice to have VSTO support for Outlook? Wouldn’t it be nice to have VSTO support for all Office apps, plus Visual Studio, Visio, and (let’s say) AutoCAD and PhotoShop? Wouldn’t it be nice to have a single, standard mechanism for loading add-ins/customizations/plug-ins into all Office applications, plus any other application that wants to play by the same rules?