none
VSTO loading problem RRS feed

  • Question

  • I am developing Addin for ms word. I having issues with it. I have reproduced it with sample http://code.msdn.microsoft.com/office/VSTO-Create-a-Custom-Task-c4919632

    Steps to reproduce 

    1. Build sample from link above

    2. launch word 2010/2013

    3. Goto options > addins > uncheck "TaskPaneWordAddin"

    4. Exit word and relaunch.

    5. Goto options > addins > check "TaskPaneWordAddin"

    result : addin doesnt load. 

    Also if i change the loadbehavior to 3 in registry then it loads. Please provide a solution for this. I am facing similar issues with my addin. Thanks in advance.


    • Edited by asingh.net Friday, January 10, 2014 8:59 AM
    Friday, January 10, 2014 7:50 AM

Answers

  • It could be a problem if you have two versions of Office installed in parallel on the same machine. And the VSTO developer environment will NOT function under such conditions. Try completely uninstalling Office then re-install the version you intend to compile for.

    If your logic is that you want to support both versions, then install Office 2010 and put 2013 on a different (or virtual) machine, for testing purposes. The Add-in compiled for 2010 should install and run on a 2013 machine with no problems. (Assuming, of course, that you don't use any features that have a different set of APIs in 2013.)


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by asingh.net Monday, January 13, 2014 7:39 AM
    Friday, January 10, 2014 5:28 PM
    Moderator
  • Removing "Visual Studio 2005 Tools For Office Second Edition Runtime" resolves the issue.
    • Marked as answer by asingh.net Tuesday, January 21, 2014 6:30 AM
    Tuesday, January 21, 2014 6:29 AM

All replies

  • There was a support case in a company I work for recently that had the same error message as we can see in the screen-shot you provide. The problem "resolved itself" by shutting down and restarting Windows. We're guessing that there was an "orphaned" instance of winword.exe in memory that was causing the problem and that rebooting Windows removed it, thus allowing the add-in to load/unload correctly...

    Cindy Meister, VSTO/Word MVP, my blog

    Friday, January 10, 2014 11:23 AM
    Moderator
  • Hi asingh.net,

    I have just tried to reproduce the issue on my PC with Visual Studio 2012 and Office 2013 installed.

    The add-in works as expected, so I couldn't reproduce the issue. Please make sure that you don't have Word listed in the list of running process after you closed it.

    Friday, January 10, 2014 11:27 AM
  • I have tried your solution.  Problem still occuring. :-(

    Friday, January 10, 2014 11:38 AM
  • There is no orphan running word process. I tried AddInSpy its giving me this log

    <addIn>
          <Item>3</Item>
          <Host>Word</Host>
          <Running>true</Running>
          <Loaded>false</Loaded>
          <Type>VSTO</Type>
          <FriendlyName>TaskPaneWordAddIn</FriendlyName>
          <ProgID>TaskPaneWordAddIn</ProgID>
          <CLSID>n/a</CLSID>
          <Manifest>file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C%23/TaskPaneWordAddIn/bin/Debug/TaskPaneWordAddIn.vsto|vstolocal</Manifest>
          <DllPath>file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C%23/TaskPaneWordAddIn/bin/Debug/TaskPaneWordAddIn.dll</DllPath>
          <LoadBehavior>2</LoadBehavior>
          <RegHive>HKCU</RegHive>
          <AssemblyName>?</AssemblyName>
          <CLR_version>?</CLR_version>
          <Exposed>false</Exposed>
          <Interfaces>?</Interfaces>
          <FormRegions>n/a</FormRegions>
          <VSTOR>2008</VSTOR>
          <Installed>?</Installed>
          <PubVer>n/a</PubVer>
          <Status>Alert</Status>
          <StatusDescription>Add-in DLL path is not found.</StatusDescription>
        </addIn>
        <addIn>

    Here are Fusion logs:

    *** Assembly Binder Log Entry (10-01-2014 @ 13:07:08) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE --- A detailed error log follows. === Pre-bind state information === LOG: User = asingh LOG: DisplayName = TaskPaneWordAddIn, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: TaskPaneWordAddIn, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL | Domain ID: 2 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/TaskPaneWordAddIn.DLL. LOG: Assembly download was successful. Attempting setup of file: C:\Users\asingh\Downloads\VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)\C#\TaskPaneWordAddIn\bin\Debug\TaskPaneWordAddIn.dll LOG: Entering download cache setup phase. LOG: Assembly Name is: TaskPaneWordAddIn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy. LOG: No application configuration file found. LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Binding succeeds. Returns assembly from C:\Users\asingh\AppData\Local\assembly\dl3\GOLERJE8.ZB3\LP2XTRGW.HYQ\d86ac4cd\7f043cc1_d60dcf01\TaskPaneWordAddIn.dll. LOG: Assembly is loaded in default load context.

    *** Assembly Binder Log Entry  (10-01-2014 @ 13:07:08) ***
    
    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.
    
    Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Running under executable  C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: User = asingh
    LOG: DisplayName = TaskPaneWordAddIn.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
     (Fully-specified)
    LOG: Appbase = file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = NULL
    Calling assembly : TaskPaneWordAddIn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: No application configuration file found.
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: The same bind was seen before, and was failed with hr = 0x80070002.
    ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).

    *** Assembly Binder Log Entry (10-01-2014 @ 13:07:08) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE --- A detailed error log follows. === Pre-bind state information === LOG: User = asingh LOG: DisplayName = TaskPaneWordAddIn.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null (Fully-specified) LOG: Appbase = file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : TaskPaneWordAddIn, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/en-US/TaskPaneWordAddIn.resources.DLL. LOG: Attempting download of new URL file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/en-US/TaskPaneWordAddIn.resources/TaskPaneWordAddIn.resources.DLL. LOG: Attempting download of new URL file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/en-US/TaskPaneWordAddIn.resources.EXE. LOG: Attempting download of new URL file:///C:/Users/asingh/Downloads/VSTO - Create a Custom Task Pane in Word (Visual Studio 2012)/C#/TaskPaneWordAddIn/bin/Debug/en-US/TaskPaneWordAddIn.resources/TaskPaneWordAddIn.resources.EXE. LOG: All probing URLs attempted and failed.

    these logs might help you. 


    • Edited by asingh.net Friday, January 10, 2014 12:26 PM
    Friday, January 10, 2014 11:44 AM
  • Hi Eugene Astafiev,

    I have Visual Studio 2010 and office 2010 and 2013. Dont know if this could make any difference?

    Friday, January 10, 2014 11:46 AM
  • It could be a problem if you have two versions of Office installed in parallel on the same machine. And the VSTO developer environment will NOT function under such conditions. Try completely uninstalling Office then re-install the version you intend to compile for.

    If your logic is that you want to support both versions, then install Office 2010 and put 2013 on a different (or virtual) machine, for testing purposes. The Add-in compiled for 2010 should install and run on a 2013 machine with no problems. (Assuming, of course, that you don't use any features that have a different set of APIs in 2013.)


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by asingh.net Monday, January 13, 2014 7:39 AM
    Friday, January 10, 2014 5:28 PM
    Moderator
  • Hi Asingh.net,

    I have got only Word 2013 installed on the machine where the add-in referenced by you was tested. I don't get any issues. It looks like you need to try to test the add-in on a PC with a single Word version installed (2010 or 2013) as Cindy suggested.  

    Saturday, January 11, 2014 11:51 AM
  • Thanks for your solution, it works. Is this a known issue of VSTO? Is it documented anywhere?
    Monday, January 13, 2014 7:42 AM
  • This is actually not a "known issue", it's "by design": VSTO was deliberately constructed to support Office only when one version is installed on a machine.

    One reason is that Office is only officially supported when that's the case. It is possible (for end-users) to install multiple versions in parallel, but it's not supported - if problems develop due to version conflicts then that's "just too bad".

    The other aspect is that the danger of possible conflicts is much greater - especially in a COM environment, and Office IS COM - when multiple versions are installed. For example, the referenced version of the type libraries to be used: only one version will be made available in the Registry. This could lead to problems during development and testing, so it simply isn't allowed.

    See:
    http://blogs.msdn.com/b/andreww/archive/2007/06/08/why-is-vs-development-not-supported-with-multiple-versions-of-office.aspx


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, January 13, 2014 6:35 PM
    Moderator
  • Ah, and the limitation is documented on this page:

    http://msdn.microsoft.com/en-us/library/bb398242.aspx


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, January 13, 2014 6:40 PM
    Moderator
  • Removing "Visual Studio 2005 Tools For Office Second Edition Runtime" resolves the issue.
    • Marked as answer by asingh.net Tuesday, January 21, 2014 6:30 AM
    Tuesday, January 21, 2014 6:29 AM