Outlook 2010加载项无法使用HRESULT中的错误异常:0x8004063E

时间:2016-05-25 18:46:28

标签: c# windows-7 vsto outlook-addin .net-4.5.2

我们有一个Outlook 2010加载项,在使用.NET Framework 4.0之前一直运行良好。 .NET框架升级到4.5.2后,它停止加载到少数用户中。机器(问题不是每个人都有,在我的机器上工作正常)。在阅读了几篇博客后,我将值0分配给用户计算机中的环境变量 VSTO_SUPPRESSDISPLAYALERTS ,并在Outlook打开并尝试加载我们的加载项时出现以下错误:

Exception from HRESULT: 0x8004063E

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x8004063E): Exception from HRESULT: 0x8004063E
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, Boolean useFastPath, IntPtr& executor)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IDomainCreator.CreateCustomizationDomain(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)

使用.Net Framework 4.0不是我们的选择,我们必须使用4.5.2。我还尝试删除注册表项 HKEY_CURRENT_USER \ Software \ Microsoft \ VSTO \ SolutionMetadata 并重新安装加载项,但这不起作用。 但是,我注意到的一件事是用户的计算机在上述注册表项下没有值 PreferredClr 。它只包含一个名为 compatibleFrameworks 的值,其中包含数据:

<compatibleFrameworks xmlns=\"urn:schemas-microsoft-com:clickonce.v2\">

<framework targetVersion=\"4.5.2\" profile=\"Full\" supportedRuntime=\"4.0.30319\" />

</compatibleFrameworks>

任何帮助将不胜感激。谢谢!

P.S:所有机器都在使用Windows 7。

1 个答案:

答案 0 :(得分:0)

重新安装用于Office运行时的Microsoft Visual Studio 2010工具(x64)解决了此问题。