none
Error when loading Add-in on specific environment RRS feed

  • Question

  • We are experiencing an odd loading error when Excel is trying to load our add-in.  I haven't seen this problem on any machines other than Windows XP, Office 2007.  Windows update runs regularly, so I can assume everything is up to date.  Here's the exception:

    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.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)

       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)

       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)

       at System.Activator.CreateInstance(Type type, Boolean nonPublic)

       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

       at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)

       at System.Activator.CreateInstance(String assemblyName, String typeName)

       at System.AppDomain.CreateInstance(String assemblyName, String typeName)

       at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)

       at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)

       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.LoadMafPipeline(AppDomain newDomain, IntPtr hostServiceProvider, AddInInformation info, EntryPoints requestedEntryPoints, OfficeApp officeApplication, OfficeVersion officeVersion, IntPtr& executor)

       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)

       --- End of inner exception stack trace ---

    We can't reproduce this on any of the machines we have in house.  I also can't find any information on this error.  The first time the user installed our add-in it worked, but then the next time they started Excel it was gone, and this error persisted.  It appears that its semi-random, in that it will occasionally load corectly (not frequently enough to be a work-around).

    I can't find much information about this, and I'm not sure where to start looking.  Has anyone else encountered this before? Any idea where to start looking?

    Thanks

    Thursday, January 3, 2013 8:53 PM

All replies