Outlook 加载项 (VSTO 4) - 添加新表单区域时 VS2010 自动引用旧的 VSTO 程序集
我有一个 Outlook 加载项项目,最初是在 Visual Studio 2008 中开发的,使用 VSTO 3.0 并面向 Outlook 2007。该项目有几个自定义表单区域,它们向特定 AppointmentItem 和 TaskItem 检查器添加了功能,这些检查器已成功添加到项目并运行良好。
去年年底,我们跳转到 VS2010,同时决定同时针对 2007 和 2010 版本的 Outlook。项目转换似乎进行得很顺利,我将项目的目标更改为使用 VSTO 4.0(根据本文的建议添加版本处理代码:http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that- quot-lights-up-quot-on-office-2010-mclean-schofield.aspx),一切似乎都很好。现有的表单区域在 2007 年和 2010 年都可以正常工作。
我正在向加载项添加一些新功能,并且作为该工作的一部分,今天向项目添加了一个新的表单区域。当我这样做时,VS2010自动向项目添加了一个VSTO 3程序集(特别是:Microsoft.Office.Tools.Outlook.v9.0.dll),这导致了各种命名空间冲突并主动搞砸了表单区域设计器。
我已经尝试了所有我能想到的方法来阻止 VS2010 自动添加此程序集 - 包括手动编辑 csproj 文件以确保没有 VSTO 3 引用 - 但这种行为仍然存在。每当我添加表单区域(使用“添加新项”->“Outlook 表单区域”)时,VS2010 都会坚持添加上述引用的程序集,这对我的项目造成严重破坏。有人在 VS2010 中经历过这种行为吗?有什么解决方法吗?
提前致谢。如果需要提供更多信息,请告诉我。
I have an Outlook add-in project that was first developed in Visual Studio 2008, using VSTO 3.0 and targeting Outlook 2007. This project had a couple of custom Form Regions that added functionality to specific AppointmentItem and TaskItem inspectors, which were successfully added to the project and worked fine.
Late last year we made the jump to VS2010, and at the same time made the decision to target both the 2007 and 2010 versions of Outlook. Project conversion seemed to go smoothly, I changed the target of the project to use VSTO 4.0 (adding in version handling code per the suggestion at this article: http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx), and everything seemed fine. The existing form regions work without problem in both 2007 and 2010.
I'm adding some new functionality to the add-in, and went to add a new Form Region to the project today as part of that work. When I did so, VS2010 automatically added a VSTO 3 assembly to the project (specifically: Microsoft.Office.Tools.Outlook.v9.0.dll) which caused all kinds of namespace collisions and actively screwed up the Form Region designer.
I've tried everything I can think of to prevent VS2010 from automatically adding this assembly - including hand-editing the csproj file to make sure there are no VSTO 3 references - yet this behavior persists. Anytime I add a Form Region (using Add New Item -> Outlook Form Region), VS2010 insists on adding the above-referenced assembly, wreaking havoc on my project. Has anyone experienced this behavior in VS2010? And is there any workaround?
Thanks in advance. Please let me know if any more info needs to be provided.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论