With Lookout we spent a ton of time just figuring out what is the “right” way to extend Outlook with a .NET based addin. This was a time consuming process because there was a lot of misinformation out there, and documentation was sparse. So, it was a lot of trial-and-error and head-banging which finally got the product out.
This week, however, the MSDN/Visual Studio teams published a new product called the Microsoft Visual Studio 2005 Tools for the Microsoft Office System – Outlook (beta). Wow! That is quite a name!
Overall, this tool looks great! It makes a lot of things really easy, which Lookout had to stumble through. Here are some of them:
Creates the Shim For you
This is a great feature because your addin will no longer need to be loaded by .NET’s mscoree.dll. If you load via the “old way” (with mscoree), then your plugin inherently cannot be run in high-security systems, and mscoree is a generic loader and is not signed. By having a shim, you can sign the shim, and then be securely loaded into Outlook. A great whitepaper was published a while back on how to do this, but the new VSTO tools now do it for you for free.
Creates a Separate AppDomain for your Addin
This is a huge new feature. By creating your addin in a separate AppDomain, it is much less likely to have conflicts with other plugins loaded into Outlook. I can’t tell you how many times different plugins that didn’t properly implement the ReleaseComObject logic hosed Lookout and we had to take support calls. With AppDomains in place, these should be a thing of the past.
Handling of Outlook Shutdown Cases
Getting Outlook to shutdown when plugins are loaded can be tricky. Making it work in 3 versions of Outlook (2000, XP, and 2003) is a process of walking through a minefield of random bugs. Fortunately, Outlook 2003 works reasonably well, but there are still a few well-documented gotchas. The new VSTO IStartup interface completely unloads the AppDomain in the shutdown cases, which should make addins no longer need to hand-craft these solutions.
Overall, kudos and thank you to the VSTO team. They didn’t have to build these helpers and tools, but by doing so they will enable a fleet of new applications that can be much more robust and interoperable. This should be a great thing if you are interested in .NET-based Outlook development.