none
Debugging OUTLOOK VSTO in VS2012 no longer opens Outlook 2013 rather it tries to open Outlook 2010 RRS feed

  • Question

  • HELP

    not very proficient with Visual Studio or Team Foundation, so be very precise with your instructions.

    here are the particulars.

    I have OFFICE 2010 (with outlook) and OFFICE 2013 (with outlook) on my development machine.

    I had an Outlook VSTO written in VS2010, that ran against Outlook 2013 just fine. I was able to debug in VS2010 and have it launch outlook 2013 just fine.

    I installed VS2013, and started modifying the VSTO (and debugging) against outlook 2013. Shelved the project for a month and forgot what version of VS I used to code and debug.

    Since the rest of the team is using VS2012, decided to uninstall VS2013 and stick with VS2012.

    and for the issue at hand.

    I can build and publish the setup.exe just fine under VS2012, but when I try to debug in VS2012 it tries to open up Outlook 2010, not outlook 2013. I have no clue how to get it to open the right version of outlook.

    Help

    Chris

    Wednesday, September 10, 2014 2:41 AM

Answers

  • You can provide a path to the program you want to use to debug your VSTO solution. 

    Right click the project in Solution Explorer and select Properties.

    Find the Debug tab and Start External Program

    Provide the path to either Outlook 10 or 13 there for debugging purposes.


    • Marked as answer by ChrisFauvel Friday, September 12, 2014 3:34 PM
    Wednesday, September 10, 2014 9:29 AM

All replies

  • Hello Chris,

    It seems you need to replace the Outlook interop reference in the project with the newest one. You need to reference the 15th version which corresponds to Outlook 2013. Visual Studio detects which Outlook version you want to run by the Outlook interop version. It doesn't matter what VS version you have installed on the machine.

    Also you may find the Running Solutions in Different Versions of Microsoft Office article helpful.
    Wednesday, September 10, 2014 6:50 AM
  • You can provide a path to the program you want to use to debug your VSTO solution. 

    Right click the project in Solution Explorer and select Properties.

    Find the Debug tab and Start External Program

    Provide the path to either Outlook 10 or 13 there for debugging purposes.


    • Marked as answer by ChrisFauvel Friday, September 12, 2014 3:34 PM
    Wednesday, September 10, 2014 9:29 AM
  • Michal,

    This is for standalone applications, but not add-ins.

    Note, when you leave the default "Start project" option selected, Outlook is started automatically. And you even didn't specify any executables! How do you think VSTO runtime decides what Outlook version to run?

    Wednesday, September 10, 2014 9:58 AM
  • Hi Chris,

    Thanks for posting in MSDN forum.

    Visual Studio 2012 does not support creating Office solutions when more than one version of Microsoft Office (or different versions of individual Office applications, such as Excel 2007 and Excel 2010) are installed side-by-side on the development computer. To create Office solutions by using the Office developer tools in Visual Studio 2012, install only Microsoft Office 2010 or Microsoft Office 2013 on the development computer.

    To devloping using Outlook 2013, I suggest that you un-install Office 2010, Office 2013 and re-install Office 2013 to fix this issue.

    You can get more detail from link below:

    Configuring a Computer to Develop Office Solutions

    Best 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.

    Thursday, September 11, 2014 1:37 AM
    Moderator
  • Thanks Eugene,

    Still not working right, and I made things worse by uninstalling Office 2010.

    It appears my Office 2013 is the click-to-run version so not sure if that is compatible or not, but do know everything was working correctly under VS2013 a month ago with no change to the references in the project(they are still, and were, pointing to version 14.0.0.0 MicroSoft.Office.Interop.Outlook)


    After uninstalling office 2010 , when I try to debug the VSTO I get an error that (Paraphrased) 

    "Unable to Debug or Run project as you are missing the correct version of office."

    Currently trying a "repair" of Office 2013 click-to-run

    Something tells me I need a DVD version of Office 2013 to properly develop this VSTO...Just by a fluke I was able to continue modify the VSTO for the last 6 months with the two office versions loaded on my machine.

    I will let everyone know if I ever get debug working on this machine.

    Chris


    Thursday, September 11, 2014 2:07 PM
  • Michal

    Eugene was correct, i tried that (when I had both office 2010 and office2013 installed) and it just simply started outlook, WITHOUT the VSTO actually launching like it has in the past.

    "How do you think VSTO runtime decides what Outlook version to run?" That is an excellent question. How was debug starting outlook 2013 for the last 6 months when in debug mode instead of outlook 2010 (before uninstalling Visual Studio 2013).

    I am nearly tempted to re-install VS2013, but I would be the only team member using VS2013, everyone else uses VS2012.

    argggg

    Chris

    Thursday, September 11, 2014 2:10 PM
  • Hi Chris,

    >>After uninstalling office 2010 , when I try to debug the VSTO I get an error that (Paraphrased) 

    "Unable to Debug or Run project as you are missing the correct version of office."<<

    I want to explain more clearly about this error message. To debug the project, we need to install the corsponding verson Office product based on the templates we created the project. For example, if you use the Office 2010 template in Visual Studio 2012, to debug the project we need to install Office 2010. 

    And if we migrting the Office 2010 to Office 2013, we need to upgrad the project too. You can get more detail about the target Office product in follow link:
    Upgrading and Migrating Office Solutions(Targeted Office Application section)

    Does this issue occure when you created a new project? If yes, it seems the enviroment was broken. I suggest that you un-install all version of Office product and Visual Studio, then re-install the Office prodcut and Visual Studio you want to debug.

    If no, I suggest that you create a new project and copy the exist code to the new project to fix this issue.

    Best 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, September 12, 2014 8:58 AM
    Moderator
  • Michal

    My appologies, it appears that you were correct. in the Properties window for the cproj file , under the DEBUG section rather than choosing Start Project radio button, instead choose Start External Program and navigate to the click-to-run version of office 2013 (C:\Program Files\Microsoft Office 15\root\office15\OUTLOOK.EXE) did in fact work.

    My mistake was that I have a Messagebox that pops up on load of outlook to let me know that the VSTO is in fact being loaded. Outllook ever so nicely disabled the loading of my vsto as it was taking so long (8-10 seconds), thus never saw the messagebox, incorrectly assuming the VSTO didn't load.

    Once I told outlook to NOT disable that VSTO it worked just fine!!!


    • Edited by ChrisFauvel Friday, September 12, 2014 3:42 PM
    Friday, September 12, 2014 3:34 PM
  • FYI everyone, you can in fact run a VSTO built on a previous microsoft.office.interop.outlook version with a newer version of office.

    I have office 2013, the vsto was initially built under VS2010 when at the time I we were running office 2010. The VSTO project was migrated to VS2012, and the office was upgraded to click-to-run office 2013.

    The above solution works, simply call a different external outlook, rather than let VS decide which version of outlook to run based on the References add to your project.


    Friday, September 12, 2014 3:40 PM