VSTO 3.0 outlook addin does not load

0

I have written a VSTO 3.0 add in for outlook. It is on the usual lines of ThisAddIn. The addin is targeted at office 2007 or above. We discovered recently that it does not work on certain workstations. Here is a summary of where it fails to load.

The addin loads and works fine on: 1) All 32-bit workstations (both windows server 2003 and windows 7) with Office 2007 2) All 32-bit workstations (both windows server 2003 and windows 7) with Office 2010

The addin does not even load on certain 64-bit workstations. We have compared the workstations where it works and where it doesn't. They are exactly the same, including the set of software installed. In fact, we spent a lot of time ensuring that both are the same in all respects.

They are both 64-bit workstations running Windows server 2003, Office 2007 (32-bit). I have figured so far that Office 2007 does not have a 64-bit version. The exact error that i receive in the event log is: Please note that i have removed the URL (VSTO URL) from this post.

Customization URI: "VSTO URL" 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 ---

***** Loaded Assemblies ******* mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5737 (QFE.050727-5700) 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.21022.1

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

I have figured out that my addin is failing to load if another addin built on similar lines gets loaded first. This addin, say, Adddin1 if loads renders my addin inactive. Addin1 is built similar to my addin- same target environment. If i disable Addin1 my addin loads fine. I do not have the liberty to change anything on Addin1 due to various reasons.
What changes can i make on my addin to load independently of any other addin?
Can i choose the order in which addins are loaded?
Is there any dependency on vstoee.dll?

Any suggestions would help. Thank you.

outlook
vsto
add-in

1 Answer

0

Procured a new workstation with all new software installation rather than applying an image. This resolved the issue.

answered on Stack Overflow Jul 3, 2013 by Sudarshan chandan

User contributions licensed under CC BY-SA 3.0