Excel VSTO加载项错误 – 无法创build应用程序域

我有一个Excel VSTO加载项,不在我的用户机器上安装。 它到目前为止安装在其他人的机器(8台机器)罚款,但在这一台特定的机器上,它给出了以下错误信息。

Customization could not be loaded because the application domain could not be created. ************** Exception Text ************** Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.TypeLoadException: Could not load type 'System.AddIn.Pipeline.QualificationDataAttribute' from assembly 'System.AddIn.Contract, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount) at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) at System.Runtime.Remoting.Metadata.RemotingCachedData.GetSoapAttribute() at System.Runtime.Remoting.InternalRemotingServices.GetCachedSoapAttribute(Object reflectionObject) at System.Runtime.Remoting.SoapServices.GetXmlTypeForInteropType(Type type, String& xmlType, String& xmlTypeNamespace) at System.Runtime.Remoting.RemotingServices.DetermineDefaultQualifiedTypeName(Type type) at System.Runtime.Remoting.Metadata.RemotingTypeCachedData.get_QualifiedTypeName() at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, ConstructorCallMessage& ctorCallMsg) at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(Type serverType) at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj) at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType) at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.DomainInitializer.ActivatePipeline(String addInAssembly, String addInClass, String[] pipelineInfo) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.DomainInitializer.StartAddIn(IntPtr hostServiceProvider, String[] pipeline, String assemblyName, String[] entryPoints) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.DomainInitializer.StartAddIn(IntPtr hostServiceProvider, String[] pipeline, String assemblyName, String[] entryPoints) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.LoadMafPipeline(AppDomain newDomain, IntPtr hostServiceProvider, String fullAssemblyName, String[] entryPoints, OfficeApp officeApplication, OfficeVersion officeVersion, IntPtr& executor) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, Boolean useFastPath, IntPtr& executor) --- End of inner exception stack trace --- ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- Microsoft.VisualStudio.Tools.Office.Runtime.v10.0 Assembly Version: 10.0.0.0 Win32 Version: 10.0.31007.0 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.v10.0.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Core Assembly Version: 3.5.0.0 Win32 Version: 3.5.30729.5420 built by: Win7SP1 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0 Assembly Version: 10.0.0.0 Win32 Version: 10.0.31007.0 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0.dll ---------------------------------------- System.AddIn Assembly Version: 3.5.0.0 Win32 Version: 3.5.30729.5446 built by: Win7SP1GDR CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.AddIn/3.5.0.0__b77a5c561934e089/System.AddIn.dll ---------------------------------------- Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0 Assembly Version: 10.0.0.0 Win32 Version: 10.0.31007.0 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll ---------------------------------------- Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0 Assembly Version: 9.0.0.0 Win32 Version: 9.0.30729.4130 CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0/9.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll ---------------------------------------- 

我不知道为什么我会得到这个错误。 从谷歌search,没有什么是从一个可敬的来源返回。 我有用户validation.NET 3.5已经安装,运行它作为pipe理员,但似乎没有任何帮助。

我有一个安装程序,自动将加载项挂接到registry中的excel,但是如果安装了VSTO,则会出现相同的错误消息。

我不明白这个错误信息告诉我什么。 谁能帮我吗?

在Windows 7 64位上,我们遇到了类似的问题。 一些参考错误是:

 Not loaded. A runtime error occurred during the loading of the COM Add-in. Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. System.TypeLoadException: Could not load type 'System.AddIn.Pipeline.QualificationDataAttribute' from assembly 'System.AddIn.Contract, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 

此问题是由Microsoft .NET Framework 3.5.1(这是操作系统的一项function)中的损坏引起的。

如何修复或重新安装.NET Framework 3.5 http://www.adminarsenal.com/admin-arsenal-blog/how-to-repair-or-reinstall-net-framework-3-5/

这篇文章声称,当遇到这个exception时,必须安装完整的 .NET框架(而不是客户端configuration文件)。 有几个人表示,这解决了他们的问题。

(理想情况下,您的VSTO应该只需要客户端configuration文件框架,您是否在VSTO中做了一些需要完整框架的东西,或者是其中的一个先决条件?)

好的 – 事实certificate这是用户机器出了问题。 如果用户卸载我的加载项,并启用他的机器上的其他人,错误消息仍然出现。 时间解决他的机器,而不是我的插件!

作为其他人的注意事项,您可以通过将variables添加到“环境variables” – >“系统variables”中来解除错误消息,以查看错误消息

variables名称: VSTO_SUPPRESSDISPLAYALERTS

variables值: 0

最终更新:

原来用户有Microsoft Office Professional Plus 2010,Visual Studio无法为此版本的Microsoft Office生成插件。

https://connect.microsoft.com/VisualStudio/feedback/details/687449/vsto-not-compatible-with-office-professional-plus-2010