如果安装了.NET framework 4,则VSTO 2005加载项无法启动

如果安装了.NET framework 4,则VSTO 2005加载项无法启动,.net,vsto,ms-office,.net,Vsto,Ms Office,我有一个针对Office 2003的VSTO 2005 Office外接程序,它是基于.NET 2构建的,运行得很好,但它只有在未安装.NET Framework 4的情况下才能工作 如果我安装.NETFramework4,它将不会启动。我已通过将环境变量VSTO_SUPPRESSDISPLAYALERTS设置为0启用了调试,因此我可以在启动Office应用程序时看到错误: “Microsoft.VisualStudio.Tools.Applications.Runtime.DomainFact

我有一个针对Office 2003的VSTO 2005 Office外接程序,它是基于.NET 2构建的,运行得很好,但它只有在未安装.NET Framework 4的情况下才能工作

如果我安装.NETFramework4,它将不会启动。我已通过将环境变量
VSTO_SUPPRESSDISPLAYALERTS
设置为
0
启用了调试,因此我可以在启动Office应用程序时看到错误:

“Microsoft.VisualStudio.Tools.Applications.Runtime.DomainFactory”的类型初始值设定项引发异常

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.Tools.Applications.Runtime.DomainFactory' threw an exception. ---> System.NotSupportedException: The Microsoft .NET Framework 2.0 or later is not correctly installed. Microsoft Visual Studio 2005 Tools for the Microsoft Office System requires the Microsoft .NET Framework 2.0 or later."
   at Microsoft.VisualStudio.Tools.Applications.Runtime.PolicyInfo.InitializeFromConfigurationFiles(PolicyLevel& enterprisePolicy, PolicyLevel& machinePolicy, PolicyLevel& userPolicy)
   at Microsoft.VisualStudio.Tools.Applications.Runtime.PolicyInfo..ctor()
   at Microsoft.VisualStudio.Tools.Applications.Runtime.DomainFactory..cctor()
   --- End of inner exception stack trace ---

如果您能提供任何帮助或想法,我将不胜感激,因为我不知道该怎么办。

结果表明,这是由于与使用构建的另一个Office插件发生冲突所致。如果卸载了另一个加载项,则我的加载项工作正常。更新其他外接程序使用的外接程序Express程序集的版本也解决了此问题。

您需要收集更多信息。看看这里的疑难解答提示:我刚刚尝试了AddInSpy,它只告诉我外接程序安装正常