C#dual Outlook 2007/2010 VSTO加载项

jon*_*ers 6 .net c# outlook vsto outlook-addin

我们需要在C#中创建一个支持Outlook 2007和2010的VSTO加载项.

首先,我们创建了3个项目:

  1. 文件 - >新建项目 - > Office-> 2007-> Outlook 2007加载项
  2. 文件 - >新建项目 - > Office-> 2010-> Outlook 2010加载项
  3. 文件 - >新建项目 - > Windows->类库

所有共享代码都在项目#3中.

到目前为止,我们已经部分开发了加载项,并一直在使用ClickOnce部署进行测试.

有一天,我们注意到有人安装了2007 Outlook的2010加载项并且没有任何不良影响.

所以有几个问题:

  • 有没有理由创建2007 VSTO项目?我们可以创建2010年的项目吗?
  • 或者,ClickOnce安装程序引导的Office运行时版本的唯一区别是什么?你能为Outlook 2007安装2010运行时吗?
  • 如果没有区别,为什么有两个Visual Studio项目模板?

在我们的最终解决方案中,我们将使用WiX安装程序,该安装程序目前也在使用.如果我们可以使用1个项目作为加载项,那么WiX安装程序将大大简化.

Jak*_*van 6

Is there any reason to create the 2007 VSTO project? Can we just create the 2010 project?
您可以使用2010项目,但如果您不小心引用任何2010 ONLY api,例如访问任何新的会话API将导致您的加载项在2007年爆炸.

Or is the only difference the version of the office runtime that is bootstrapped by the ClickOnce installer? Can you just install the 2010 runtime for Outlook 2007?
基本上,您正在编写适用于2007和2010的VSTO 3.0加载项.VSTO实际上并不关心您要编写的模板,只是您的加载项是VSTO 3.0加载项.

If there is no difference, why are there two Visual Studio project templates?
我可以看到2个原因,F5调试支持,并确保您不访问新的API'

如果您确实沿着2010年唯一的附加路走下去,我建议您针对Microsoft.Office.Interop.Outlook v12 PIA编译解决方案,它将向您显示您正在访问的任何新API.如果您确实想要定位其中一些新API,只有在2010年托管您的加载项时,请查看http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating- AN-附加换办公室2007年和办公室-2010-是-QUOT灯-上- QUOT-在办公室2010年-麦克莱恩,schofield.aspx