none
Debug VSTO without having to install every time RRS feed

  • Question

  • I am developing an application-level ribbon extension for Excel 2007 using VS2010 and VSTO. I am able to debug the code, but my problem is, every time I make a change to the code I need to uninstall/reinstall the extension (I have a Setup project as well). Otherwise, the extension does not show up in the Excel UI. Is there any way to debug updated code without having to reinstall the extension?

    Thanks for any help.

    Tuesday, September 22, 2015 10:08 PM

Answers

  • Hi JonCD,

    Since you mentioned that you have to re-install the Office solution to make it work, did you install the Office after you build the project?

    Based on my understanding, there is no necessary to install the Office solution on the development machine. It works as long as we build the project.

    I suggest that you try to create a new blank project to see whether the issue could be reproduced.

    If I misunderstanding, please feel free to let me know.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 9, 2015 9:41 AM
    Moderator

All replies

  • Hello Jon, 

    There is no need to install/uninstall the add-in to be able to debug the add-in. If you develop VSTO based add-in you just need to re-build the project and then run it for debugging. See the following pages for more information:

    Create VSTO Add-ins for Office by using Visual Studio

    Walkthrough: Creating Your First VSTO Add-in for Excel

    Getting Started Programming VSTO Add-ins

    If you deal with a shared add-in you need to add all the required windows registry keys to get the add-in running. See Registry Entries for VSTO Add-ins for more information.

    Be aware, Microsoft Office applications can disable VSTO Add-ins that behave unexpectedly. If an application does not load your VSTO Add-in when you try to debug it, the application might have hard disabled or soft disabled your VSTO Add-in.

    Hard disabling can occur when an VSTO Add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your VSTO Add-in is executing.

    Soft disabling can occur when a VSTO Add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable a VSTO Add-in if it throws an unhandled exception while the Startup event handler is executing.

    When you re-enable a soft-disabled VSTO Add-in, the application immediately attempts to load the VSTO Add-in. If the problem that initially caused the application to soft disable the VSTO Add-in has not been fixed, the application will soft disable the VSTO Add-in again.

    Read more about that in the How to: Re-enable a VSTO Add-in That Has Been Disabled article. 

    Also make sure that you don't get any UI errors. By default, if an VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom Ribbon does not appear, or why a Ribbon appears but no controls appear. See How to: Show Add-in User Interface Errors . 

    • Proposed as answer by David_JunFeng Monday, September 28, 2015 2:16 PM
    Wednesday, September 23, 2015 6:27 AM
  • >>>Is there any way to debug updated code without having to reinstall the extension?

    You can debug Office projects by using the same Microsoft Visual Studio tools you use for other Visual Studio projects. Visual Studio debugger features, such as the ability to insert breakpoints and view variables in the Locals window, are also available when you debug Office projects.

    The Visual Studio debugger allows you to observe the run-time behavior of your program and locate logic errors. The debugger works with all Visual Studio programming languages and their associated libraries. With the debugger, you can break, or suspend, execution of your program to examine your code, evaluate and edit variables in your program, view registers, see the instructions created from your source code, and view the memory space used by your application. With Edit and Continue, you can make changes to your code while debugging, and then continue execution.

    For more information, click here to refer about Debugging Office Projects and here to refer about Debugger Roadmap

    • Proposed as answer by David_JunFeng Monday, September 28, 2015 2:16 PM
    Thursday, September 24, 2015 1:10 AM
  • David and Eugene,

    Thank you for your replies to my question. However, my problem is not that I cannot debug my code or that I don't know how. My problem is, every time I make a change to the code I have to reinstall the extension for it to show up in the Excel UI. I know I should be able to debug any changes without having to reinstall but currently that is not the case. Can you suggest any ways to figure out what might be going wrong? I did checked the "Show user add-in interface errors" in Excel Options -> Advanced -> General but that does not show any errors.

    Thanks again for your help.

    Monday, September 28, 2015 3:25 PM
  • Hi JonCD,

    Since you mentioned that you have to re-install the Office solution to make it work, did you install the Office after you build the project?

    Based on my understanding, there is no necessary to install the Office solution on the development machine. It works as long as we build the project.

    I suggest that you try to create a new blank project to see whether the issue could be reproduced.

    If I misunderstanding, please feel free to let me know.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, October 9, 2015 9:41 AM
    Moderator