使用VSTO 40的Outlook 2010插件和目标.NET Framework 3.5无法正常工作 [英] Outlook 2010 addin using VSTO 40 and targetting .NET framework 3.5 not working

查看:93
本文介绍了使用VSTO 40的Outlook 2010插件和目标.NET Framework 3.5无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio 2010和VSTO 4.0创建了一个Outlook 2010插件。针对.NET fw 3.5。我想通过添加自定义选项卡来自定义资源管理器功能区。当我启动outlook 2010时,我在事件查看器中收到以下错误,并且插件管理器说:"加载插件时出现运行时错误"。


 


自定义URI: file:/// c:/ documents 和settings / eiuser200 / my documents / visual studio 2010 / Projects / OutlookAddIn1 / OutlookAddIn1 / bin / Debug / OutlookAddIn1。 vsto
例外:< compatibleFrameworks xmlns =" urn:schemas-microsoft-com:clickonce.v2">
  < framework targetVersion =" 3.5"轮廓= QUOT;客户" supportedRuntime = QUOT; 2.0.50727" />
< / compatibleFrameworks>


< / compatibleFrameworks>
   **************异常文本**************
Microsoft.VisualStudio.Tools.Applications.Deployment.FrameworkVersionMismatchException:< compatibleFrameworks xmlns = QUOT;瓮:架构 - 微软-COM:clickonce.v2">
&NBSP; < framework targetVersion =" 3.5"轮廓= QUOT;客户" supportedRuntime = QUOT; 2.0.50727" />
< / compatibleFrameworks>
&NBSP;&NBSP;在Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.Install(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager,OfficeAddInDeploymentManager officeDeploymentManager,AddInInformation& info)
  在Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager,OfficeAddInDeploymentManager officeAddInDeploymentManager,AddInInformation&安培;信息)
&NBSP;&NBSP;在Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager,OfficeAddInDeploymentManager officeAddInDeploymentManager,布尔showUIDuringDeployment)
&NBSP;&NBSP;在Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation,String manifestName,String documentName,Boolean showUIDuringDeployment,IntPtr hostServiceProvider,IntPtr& executor)


我可以定位3.5框架使用VSTO 4.0并仍然利用新的Outlook 2010平台功能(资源管理器功能区,后台视图)?


谢谢,
Furqan

解决方案

您好Furqan,


您看到的异常并不是您的插件未加载的原因。请参阅我的博客文章这里


尝试将VSTO_SUPPRESSDISPLAYALERTS环境变量设置为0.然后将加载项的loadbehavior设置为3(查看这里获取更多信息),然后重新启动Outlook。然后请告诉我们您看到的是什么类型的错误。


您可以定位3.5并仍然为Outlook 2010开发插件。


Hamed


I have created an Outlook 2010 addin using Visual studio 2010 and VSTO 4.0. targeting .NET fw 3.5. I am trying to customize explorer ribbon by adding a custom tab. When I launch outlook 2010, i get the following error in event viewer and the addin manager says: "There was a runtime error when loading the addin".

 

Customization URI: file:///c:/documents and settings/eiuser200/my documents/visual studio 2010/Projects/OutlookAddIn1/OutlookAddIn1/bin/Debug/OutlookAddIn1.vsto
Exception: <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="3.5" profile="Client" supportedRuntime="2.0.50727" />
</compatibleFrameworks>

</compatibleFrameworks>
   ************** Exception Text **************
Microsoft.VisualStudio.Tools.Applications.Deployment.FrameworkVersionMismatchException: <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
  <framework targetVersion="3.5" profile="Client" supportedRuntime="2.0.50727" />
</compatibleFrameworks>
   at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.Install(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeDeploymentManager, AddInInformation& info)
   at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, AddInInformation& info)
   at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, Boolean showUIDuringDeployment)
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)

Can I target 3.5 framework with VSTO 4.0 and still leverage the new Outlook 2010 platform features (Explorer ribbon,backstage view)?

Thanks,
Furqan

解决方案

Hi Furqan,

The exception you are seeing is not the reason why your addin is not loading. please refer to my blog post here.

try setting the VSTO_SUPPRESSDISPLAYALERTS environment variable to 0. then set the loadbehavior of your addin to 3 (look here for more info), and restart Outlook. Then please tell us what kind of error you are seeing.

You can target 3.5 and still develop addins for Outlook 2010.

Hamed


这篇关于使用VSTO 40的Outlook 2010插件和目标.NET Framework 3.5无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆