none
VSTO prerequisites for Office 2010 and 2007 target machines RRS feed

  • Question

  • Hi,

    i have developed a vsto using visual studio 2010 for office word and office outlook. the type is outlook and word 2007 add in. when i debug it, it runs both on office 2007 and office 2010. and also when i publish the add-ins from visual studio, i managed to install the published add-ins to both 2007 and 2010 office system.

    after that i create an installer for the vsto add ins. it successfully installs and loads on the machines with 2007 office systems, but it failed to load on the machines with office 2010. the error is about the COM add-in fails to load.

    my question is, what PIA should i include as the pre-requisites if i want to target both office 2007 and office 2010?

    on the current installer i didn't include any PIA as the pre-requisites.

    thanks in advance.


    -Regards- Willy Noviandy


    • Edited by Wie Lie Monday, April 23, 2012 8:40 AM add explanation
    Monday, April 23, 2012 7:19 AM

Answers

  • exception messages says all - your SynchronizeUtility constructor threw an error during initialization. Please debug/inspect and fix that error.
    Tuesday, May 1, 2012 7:25 PM

All replies

  • you should use lowest common denominator which here means PIA 2007 - best it would be to bundle needed dlls with your add-in (as private assemblies) and do not make global prerequisite for PIA installations. But of course if you want to have this prerequisite, go for 2007 PIA. And a second thing - remember that office 2010 comes in 2 bit flavours - 32 and 64 - you should have 2 separate installers, one for each bitness.

    Monday, April 23, 2012 8:54 AM
  • Hi Damian,

    i have followed an article from technet to create a vsto installer. when i create the installer project using visual studio 2010, the private assemblies is considered as detected dependencies and i should remove it from the list. and also, i have read that private assembly is different than the PIA. those private assemblies is targeting the interop assembly from office system meanwhile primary interop assembly is different says the article. sorry if i get you wrong on this particular issue.

    according to the customer, all of the client computers should have 32 bit application installed.

    i already tried to add the 2007 PIA, but when i run the installer my launch condition for the installer causes the installer to stop. do you happen to have a guide to create a launch condition properties for vsto installer?

    thanks.


    -Regards- Willy Noviandy


    • Edited by Wie Lie Monday, April 23, 2012 9:15 AM add explanation
    Monday, April 23, 2012 9:13 AM
  • what i do is on dev machine take dlls i need from PIA directory, store them along with project and reference them. I also deploy them with my installer as private assemblies along with all other my dependencies. This way PIA assemblies are the same (most probably article you mention was talking about generating your own interop assemblies, which you should avoid).

    Monday, April 23, 2012 9:58 AM
  • hi Damian,

    i already referenced the PIAs in my project.

    here's my setup project detected dependencies look like

    i only include the sharepoint client dll as the dependencies.

    now, if i add my launch condition with the office 2007 Shared PIA, Outlook 2007 Shared PIA, and Word 2007 Shared PIA, the installer won't continue when i try to install it on the machine with office 2010 installed. if i removed those launch conditions, it will install correctly but the COM add-ins won't load both on outlook 2010 and word 2010.

    i think i get it wrong in the launch condition, but i don't know where. -_-"

    because when i install the add ins from publishing the outlook add in and word add in projects, it installs smoothly both on machines with 2007 office systems and 2010 office systems. but now when i packaged all the installer for the add-ins, i ran into problems.

    any idea?

    thanks.


    -Regards- Willy Noviandy

    Thursday, April 26, 2012 7:16 AM
  • my suggestion was to avoid launch conditions/prerequsites that depend on PIA - as i said above - reference only needed dlls from PIA from your private location and deploy them along your add-in. This way problem will be solved.
    Thursday, April 26, 2012 7:27 AM
  • Hi Damian,

    i removed the launch condition which related to the PIA, and i already add the dlls from PIA.

    the installer package installs successfully both on machines with office 2007 and office 2010 system.

    the only problem is on the machine with office 2010 system, there's an error while loading the add-in.

    the error message --> "Not Loaded. A runtime error occured during the loading of the COM Add-in.

    pls advise.

    thanks.


    -Regards- Willy Noviandy

    Friday, April 27, 2012 7:22 AM
  • http://msdn.microsoft.com/en-us/library/ms269003(v=vs.80).aspx

    set env variable VSTO_SUPPRESSDISPLAYALERTS to 0 and try to enable add-in, you should see what is wrong. Also please remember that startup event of addin must be in try/catch all block, otherwise any exception that escapes this event handler will disable your add-in.

    Friday, April 27, 2012 7:33 AM
  • Hi Damian,

    this is my stack trace when the error occured while loading the add in using Outlook 2010

    Log entry added at 3:52:23 PM:
    -----------Caption----------------
    Microsoft Office Application Add-In
    -----------Message----------------
    An add-in could not be found or could not be loaded.
    -----------Details----------------
    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.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'IDXeDocOutlook.ThisAddIn' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at IDXeDocOutlook.SynchronizeUtility..ctor()
       at IDXeDocOutlook.ThisAddIn..cctor()
       --- End of inner exception stack trace ---

       --- End of inner exception stack trace ---
       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.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       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.3625 (GDR.050727-3600)
        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.3631 (GDR.050727-3600)
        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.1 built by: SP
        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.1 built by: SP
        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
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------

    any advise?

    thanks.


    -Regards- Willy Noviandy

    Tuesday, May 1, 2012 9:06 AM
  • exception messages says all - your SynchronizeUtility constructor threw an error during initialization. Please debug/inspect and fix that error.
    Tuesday, May 1, 2012 7:25 PM