Outlook 2010加载项无法工作,出现错误HRESULT:0x8004063E中的异常



我们有一个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>

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

附言:所有的机器都在使用Windows7。

重新安装Microsoft Visual Studio 2010 Tools for Office Runtime(x64)解决了此问题。

最新更新