无法创建应用程序域 - Excel的VSTO加载项错误 [英] Excel VSTO Add-in error - application domain could not be created

查看:751
本文介绍了无法创建应用程序域 - Excel的VSTO加载项错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel VSTO加载项未安装在我的用户的机器之一。它安装罚款,其他人的机器至今(8位机),但是这一个特定的机器上它给下面的错误信息。

I have an Excel VSTO Add-in that is not installing on one of my users machines. It installs fine on everyone else's machine so far (8 machines), but on this one specific machine it is giving the following error message.

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
----------------------------------------

我不知道我为什么会得到这个错误。从谷歌上搜索四周,没有什么是从一个受人尊敬的源返回。我有用户验证.NET 3.5的安装,运行它以管理员身份,但似乎没有任何帮助。

I am not sure why I would be getting this error. From googling' around, nothing was returned from a respectable source. I had the user validate that .NET 3.5 was installed, ran it as administrator, but nothing seems to help.

我有一个安装程序,自动挂钩外接从注册表中出类拔萃,但如果安装了VSTO,相同的错误消息出现。

I have an installer that automatically hooks the add-in to excel from the registry, but if the VSTO is installed, the same error message occurs.

我不明白这是什么错误消息告诉我。谁能帮助我?

I can't understand what this error message is telling me. Can anyone help me out?

推荐答案

确定 - 以及原来这是一件错误的用户计算机。有用户卸载我的加载项,使其他的人他的机器,仍然出现错误消息。时间给他解决,而不是我的外接机!

Ok - well turns out it was something wrong with the users machine. Had the user uninstall my add-in and enable other ones on his machine and the error message still appeared. Time to troubleshoot him machine instead of my add-in!

至于其他人的笔记,你可以添加一个变量到环境变量看到UNSUP pressing错误消息的错误信息 - >系统变量

As a note for other people, you can see the error messages by unsuppressing error messages from adding a variable into Environment Variables -> System Variables

变量名: VSTO_SUP preSSDISPLAYALERTS

变量值: 0

最后更新:

原来,用户的Microsoft Office专业增强版2010和Visual Studio是无法为这种版本的Microsoft Office的加载项。

Turns out the user has Microsoft Office Professional Plus 2010 and Visual Studio is unable to produce add ins for this version of Microsoft Office.

<一个href="https://connect.microsoft.com/VisualStudio/feedback/details/687449/vsto-not-compatible-with-office-professional-plus-2010" rel="nofollow">https://connect.microsoft.com/VisualStudio/feedback/details/687449/vsto-not-compatible-with-office-professional-plus-2010

这篇关于无法创建应用程序域 - Excel的VSTO加载项错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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