none
VSTO Document level customization error RRS feed

  • Question

  • Hello all,

    I am trying to create a VSTO document level customization using Visual Studio 2010, Word 2010, VSTO (ínstalled with VS2010), Windows 7.  When I debug my solution, Word 2010 opens fine, but I get the following error message and it doesn't load my assembly. There aren't any details, and I have difficulty trying to figure out the cause. I have adminstrative rights on my PC and I have added the solution location to the "Trusted Location" in Word 2010.

    Any help would be greatly appreciated. Thanks,

    Greets

    Wednesday, January 25, 2012 9:07 AM

Answers

  • Hi Sam

    OK, so we've narrowed it down and it looks like this is a damaged Visual Studio installation. That's not my area of expertise...

    I would have tried a "Repair", rather than uninstall/reinstall. I'm not sure if the result would be the same, but from the steps you've tried, I have to wonder if there isn't a problem in the Registry. An uninstall doesn't always catch these and, from painful experience, I know that such things are also difficult to track down and correct.

    So the next thing I'd try would be to create a new user profile on your machine, install Office and Visual Studio, then test again.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by samwillie Monday, January 30, 2012 9:15 AM
    Friday, January 27, 2012 7:44 AM
    Moderator

All replies

  • Hi Sam

    Could you please give the exact steps you use to "debug the solution"? Do you use F5 from within Visual Studio or are you opening the document from Windows Explorer (or something similar)?


    Cindy Meister, VSTO/Word MVP
    Wednesday, January 25, 2012 9:39 AM
    Moderator
  • Hi Cindy,

    Here is what I have tried so far:

    • Use the F5 button in Visual Studio menu to debug the solution. Word dialog opens but then I get the error dialog mentioned previously.
    • Build the solution and going into the project's bin\debug folder and clicking the .vsto deployment manifest file.  This installs the assembly and I see the assembly in the Control Panel. But when I click open the customized template, I get the error message.
    • I checked the Event Log Viewer (Event Viewer -> Application and Service Logs ->Microsoft->Windows->Microsoft Office Alerts, but I don't find any details there.

    Hope this helps, I have been at it since yesterday and I don't have a clue..

    Many thanks,

    Greets

    Wednesday, January 25, 2012 9:54 AM
  • Hi Cindy,

    Additional information:

    When I close the error dialog box and check the document properties (Prepare->Properties->Advanced Properties), under the "Custom" tab, I see the _Assembly Location as "TestAssembly|086e288f-0052-40fa-89db-340fd9b8f16b|vstolocal"

    Many thanks,

    Greets,

    Wednesday, January 25, 2012 10:06 AM
  • Hi Sam

    How about if you set a breakpoint in the ThisAddin_Startup procedure? Does the execution get that far?

    And if you create a new project for Word 2010, then press F5 will that load?


    Cindy Meister, VSTO/Word MVP
    Wednesday, January 25, 2012 10:36 AM
    Moderator
  • Hi Cindy,

    Thanks for the tips. I still get the error message though. Here is what I tried.

    Set a breakpoint in the ThisAddin_Startup procedure and also add a MessageBox.Show("Test") inside the procedure. But the execution never reaches the breakpoint and the error dialog that assembly cannot be loaded pops up.

    I created a new project using the option (Copy an existing document) as I have a template that needs to be used for this solution. And do a successful build and do F5, but still I get the error dialog.

    Greets,

    Thursday, January 26, 2012 8:34 AM
  • Hi Sam

    Do a new project without copying an existing document, please?


    Cindy Meister, VSTO/Word MVP
    Thursday, January 26, 2012 5:10 PM
    Moderator
  • Hi Cindy, 

    Oh..I never tried this!  Okay, so when I choose the option (Create new document) the Visual Studio crashes completely (closes). I have to click open Visual Studio 2010 to reopen it again.

    I checked the Event Viewer once again and under the Application category, there is an "Application error" and it gives me the path of the "devenv.exe" and the path of the dll "VSTOWordClientPkg.dll". There is no other error message there, except that of "Application error".

    So, I deleted this dll thinking it might have been corrupt and copied this dll over from my colleague's Visual Studio 2010 Premium installation, but I still get the error. 

    I uninstalled and re-installed my Visual Studio 2010 (Premium) edition, but the issue persists. So, I went over to another colleague who has Visual Studio 2010 (Ultimate) edition installed to try the same. I can create a new project there with both the options and I don't see the error message there at his computer.

    This is all what I tried so far - thanks for your time Cindy...

    Greets,

     

    Thursday, January 26, 2012 9:45 PM
  • Hi Sam

    OK, so we've narrowed it down and it looks like this is a damaged Visual Studio installation. That's not my area of expertise...

    I would have tried a "Repair", rather than uninstall/reinstall. I'm not sure if the result would be the same, but from the steps you've tried, I have to wonder if there isn't a problem in the Registry. An uninstall doesn't always catch these and, from painful experience, I know that such things are also difficult to track down and correct.

    So the next thing I'd try would be to create a new user profile on your machine, install Office and Visual Studio, then test again.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by samwillie Monday, January 30, 2012 9:15 AM
    Friday, January 27, 2012 7:44 AM
    Moderator
  • Hi Cindy,

    Thank you so much :-) I did a clean install of Windows 7 again, installed Office 2010, and installed Visual Studio 2010 and everything works fine as before! The assembly loads correctly now. So, a damaged dll was causing this issue then.

    Greets,

    Monday, January 30, 2012 9:19 AM