none
Word 2010 Application AddIn does not load

    Question

  • Our development machine is 64 bit hardware running Windows 7 Professional N (64 bit), 64 bit Office Professional 2010 and Visual Studio Professional 2010. 

    We created a Word 2010 (Application Level Addin) using .net framework 4 , Ribbons and windows installer targeting Office 2010 using this link http://msdn.microsoft.com/en-us/vsto/ff937654.aspx . We followed everything to the dot several times. For our installer we selected .net 4 client profile and windows installer 3.1 as prerequisites, since Office 2010 has VSTO 4.0 runtime installed and .net framework 4 has no-PIA functionality. In launch conditions we checked for Office 2010 Shared PIA and Word 2010 PIA availability using the appropriate component ids. Additionally we checked for VSTO runtime availability as  is laid out in the link aforementioned.

    Our addin loads and executes with full functionality from ONLY within Visual Studio debug (F5). Building the setup project creates the windows installer (msi). Installing it(msi) installs the addin on the machine without any errors either. However after installing the addin when we try to open any Word 2010 document, we are witnessing the following behavior...

    The first time we try open any Microsoft Word 2010 document, Word 2010 startup screen shows up and we can see our addin being loaded "Loading [Our]Addin"  but then Word 2010 does not open. The startup screen disappears and no error message is displayed. 

    Opening the word document for the second time just fires up this message (no word 2010 startup screen this time) "Word experienced a serious problem with the '[Our] word addin' add-in. If you have seen this message multiple times, you should disable this add-in and check to see if an update is available. do you want to disable this add-in?' 

    Clicking on No, briefly fires up the startup screen of Microsoft Word 2010 and then it stops loading again(disappears) Clicking on Yes, opens Word 2010 with the [Our] add in disabled. Verified by clicking File-Options-AddIns. Looked under Disabled Application Add-Ins 

    Setting VSTO_SUPPRESSDISPLAYALERTS=0 and VSTO_LOGALERTS=1 was of no use either. We checkeed our Temp directory, there were no logs.

    I installed and set up vsto troubleshooter (Windows PowerShell) from this link http://code.msdn.microsoft.com/vstotroubleshooter . The following is the output of
    ".\vstroubleshooter.ps1 info Word" when [Our] addin in disabled in Word 2010.
     
    ==============================================================
     Software's Installed 
    ============================================================== 
    Microsoft Windows 7 Professional N ( 64-bit ) 
    Office 2007 1 
    Office 2010 (32-bit) 0
    Office 2010 (64-bit) 1 
    ==============================================================
    VSTO Runtime 
    ============================================================== 
    VSTO Runtime 4.0 - (10.0.21022 Installed via Office 2010)
    VSTO Runtime 4.0 - (CLR35 components via Office 2010)
    VSTO Runtime 4.0 - (Unmanaged components via Office 2010)
    ============================================================== 
    AddIns Installed under Registry Path HKCU:\SOFTWARE\Microsoft\Office\Word\AddIns
    LoadBehavior 0: Unloaded, 1: Loaded, 2: Unloaded, 3: Loaded, 8: Unloaded, 9: Loaded, 16: Loaded To get values for LoadBehavior see http://msdn.microsoft.com/en-us/library/bb386106.aspx#LoadBehavior 
    ==============================================================
    OneNote Notes about Word Documents ( LoadBehavior: 0 ) 
    [Our] AddIn ( Load Behavior: 3) 
    Microsoft Word East European Fonts Tool ( LoadBehavior: 8 ) 
    ============================================================== 
    Solution Metadata under Registry Path HKCU:\Software\Microsoft\VSTO\SolutionMetadata
     ============================================================== 
    {09DBE83A-8F54-4DDD-95E7-2FBC94FD53D4} ( PreferredClr: v4.0.30319 )
    {23ED0609-9991-427E-9BFF-FB4741B839C9} ( PreferredClr: v4.0.30319 )
    {297E780A-6F2E-4389-9C52-A70AFD6EED5D} ( PreferredClr: v4.0.30319 )
    {2D5DE556-B1C4-4496-8F6B-162112142CD2} ( PreferredClr: v4.0.30319 ) 
    {37EF77D7-3DF5-486A-8373-3B90D673107E} ( PreferredClr: v4.0.30319 )
    {3A62BFB2-928F-4416-9BC0-6006E8B29347} ( PreferredClr: v4.0.30319 )
    {3C2A08AF-D70F-41A7-9575-CA6A151CD992} ( PreferredClr: v4.0.30319 )
    {3DB04618-F130-4A9E-8BEC-05BDCCA1DBEA} ( PreferredClr: v4.0.30319 ) 
    {51F5AB52-5D89-404D-A24E-7EFF05B42098} ( PreferredClr: v4.0.30319 )
    {659C8805-71EA-47E6-AFE1-F9EE77C063CB} ( PreferredClr: v4.0.30319 ) 
    {65DD0BBD-3511-4938-8EFF-273CBB4DF0F1} ( PreferredClr: v4.0.30319 )
    {78EF1D37-B0CE-42BE-A839-93BCC86A675D} ( PreferredClr: v4.0.30319 )
    {989CC438-434D-4B6C-B1CD-38CB5DDB0195} ( PreferredClr: v4.0.30319 )
    {A17F17B8-0CFA-4346-951A-8711EBD034EF} ( PreferredClr: v4.0.30319 )
    {A98EB492-5E16-4007-9D05-FFC350035387} ( PreferredClr: v4.0.30319 ) 
    {FB05E5FE-0A74-4556-9EA9-42E4DEB0C363} ( PreferredClr: v4.0.30319 ) 
    ============================================================== 
    VSTA Solutions under Registry Path HKCU:\Software\Microsoft\VSTA\Solutions
    ==============================================================
    ============================================================== 
    Hard-disabled AddIns for Word under HKCU:\Software\Wow6432Node\Microsoft\Office\12.0\Word\Resiliency\DisabledItems ============================================================== 
    ==============================================================
    Disabled AddIns for Word under HKCU:\Software\Microsoft\Office\14.0\Word\Resiliency\DisabledItems 
    ============================================================== 

    I'm surprised why [our] addin still shows load behavior 3 and is not listed under Disabled or Hard Disabled AddIns.

    Next, since the above method did not work I downloaded the sample project from this link http://code.msdn.microsoft.com/VSTO2010MSI named 'Deploying a VSTO 2010 solution for Office 2007/2010 using Windows Installer'  and used the appropriate project found under Office Development - Setup and Deployment Projects Samples\FX40\AddIn Deployment\All User Install for 64-bit Office.

    Initally I tested the solution to correctly load the demo excel 2010 add in project by creating and running the installer(msi) Then we added our Word AddIn project to the solution file by file and built it correctly (CTRL+SHIFT+B). It even ran from visual studio debug (F5) correctly. Then we reconfigured the existing set up project to delete the demo excel project and load our word  Addin primary output, [OurAddin].vsto and [OurAddin].dll.manifest files. We refreshed project dependencies and took appropriate steps to exclude relevant files. We kept the registry checks intact and added launch conditions to check for Word 2010 PIA. 

    The installer built successfully (msi), installed without errors but unfortunately we witnessed the exact same behavior of Word 2010 as described previously. 

    We tried debugging using windows event logging http://msdn.microsoft.com/en-us/library/cc442816.aspx .
     I found this event with event id 4096

    ************** Exception Text **************
    Microsoft.VisualStudio.Tools.Applications.Deployment.FrameworkVersionMismatchException: <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
     <framework targetVersion="4.0" profile="Client" supportedRuntime="4.0.30319" />
     <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
    </compatibleFrameworks>
    
    
    However I found this link where Hamed Ahmadi explains this is no cause for an Addin not to load. http://blogs.msdn.com/b/vsto/archive/2010/04/06/why-is-frameworkversionmismatchexception-thrown-hamed-ahmadi.aspx
     

    We need to create an installer for our Word addin for both 32-bit and 64-bit Word 2010. Any guidance would be appreciated.
    Wednesday, October 06, 2010 12:29 PM

Answers