none
Cannot debug Outlook 2007 add-in RRS feed

  • Question

  • Visual Studio 2010, Microsoft Outlook 2007, Windows 7 all latest updates and service packs as of today (02/08/11). Project is Outlook 2007 add-in using VSTO targeting .NET framework 3.5, build configuration 'debug'.

    • Outlook running -> Start debugging -> Error: 'You cannot debug the add-in because 'Outlook' is already running. Close 'Outlook' and then run the project again.' --- As expected.
    • Outlook NOT running -> Start debugging -> Error: 'You cannot debug or run this project, because the required version of the Microsoft Office application is not installed. ---- Yes it bloody well is!
    • Project -> Properties -> Debug -> Start Action = Start external program: .../Office12/OUTLOOK.EXE -> Start debugging -> Outlook starts -> No symbols loaded -> breakpoints ignored -> Exception thrown from a line that cannot possibly throw an exception. (It doesn't seem to be my code running at all).
    • Create new 'Release' build -> run VSTO deployment file -> install add-in -> runs perfectly... but I can't debug it this way and really don't want to create a new build number every time I want to see if it works or not.

    I spend the vast majority of my working time looking for, and implementing workarounds for bugs created by Microsoft but this one has me stumped. I've tried re-installing every piece of software concerned, applied all updates and even tried shouting at it. PLEASE HELP ME.

    Tuesday, August 2, 2011 3:26 PM

Answers

  • Answer to debugging: Visual Studio 2010 Service Pack 1. 

    Answer to Outlook version: Still thinks wrong version is installed, but specifying the executable works as long as the VS2010 SP1 has been applied correctly.

    • Marked as answer by B1GRU55 Wednesday, April 18, 2012 2:09 PM
    Wednesday, April 18, 2012 2:08 PM

All replies

  • Have you checked the references in Project > Properties > References? Obviously it should be 12.0 for Outlook.

    Did you start this solution fresh as an Outlook 2007 add-in or did you copy it from another version?

    What language are you using?

     


    Kind Regards, Rich ... http://greatcirclelearning.com
    Tuesday, August 2, 2011 8:36 PM
  • I think you mean the reference to Microsoft.Office.Interop.Outlook, which yes, points to "C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12\Microsoft.Office.Interop.Outlook.dll", and Office.dll is pointing to C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office12\Office.dll also.

     

    Most of the code files that the project consists of are links to files in the 2010 equivalent add-in (except for the command bar obviously) to avoid code duplication (not my idea). I didn't start this project at all, I have inherited this product from my predecessor and debugging definitely used to work. I'm thinking I must have done something to the system to work around another Microsoft bug that has had an undesired knock-on affect on this, but I have no clue what.

     

    I am using c# and it's a 32-bit system.

     

    Thanks for your interest.

    Wednesday, August 3, 2011 8:19 AM
  • Answer to debugging: Visual Studio 2010 Service Pack 1. 

    Answer to Outlook version: Still thinks wrong version is installed, but specifying the executable works as long as the VS2010 SP1 has been applied correctly.

    • Marked as answer by B1GRU55 Wednesday, April 18, 2012 2:09 PM
    Wednesday, April 18, 2012 2:08 PM