locked
Debugging Add-In in VS 2008 using VS 2010 RRS feed

  • Question

  • Hi,

    this is (another) question about debugging Add-Ins with Visual Studio 2010.

    I have defined two debug configurations in my Add-In solution, with the intention of debugging my Add-In in VS 2010 or VS 2008, depending on the selected configuration.

    However, when I select my 'Debug VS 2008' configuration and start the debugger, it always starts VS2010. I have specified the full path to the version of devenv.exe for VS 2008, but I can't get it to start in the debugger.

    Does anybody have an idea what I am doing wrong?

    I realize that this operation has nothing specifically to do with Add-Ins. I also realize that I am probably being stupid, but maybe somebody has an idea.

    Phil

    Thursday, May 6, 2010 10:11 PM

Answers

  • Hello, again

    How do you configure the debug?

    Please follow the below steps to debug in 2008 when the add-in is in 2010.

    1.     Add the VS2008 AddIns folder to the 2010. Click “Tools”->”Options”->Expand “Environment”->Click “AddIn/Macro security”. Then click “Add” to add the 2008 addins folder, on my side is <Users>\Documents\Visual Studio 2008\Addins.

    2.     Create an add-in which target .net 2.0, Note: You could not create a .net 4.0 add-in, otherwise the add-in could not be loaded in VS2008.

    3.     After creating the add-in, right click your add-in project, click Debug panel. In the “Start external program” textbox, add the vs2008 exe path here. This is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe on my side. In Commandline argument textbox, you must ensure it is like /resetaddin AddIn20.Connect.

    4.     Then click debug, you will find the VS2008 started and it loads your add-in.

    Thanks

    Chao

     

    • Marked as answer by Chao Kuo Friday, May 14, 2010 2:49 AM
    Tuesday, May 11, 2010 10:40 AM
  • Hi Phil,

    This should be possible. I had no problem rebuilding my VS 2008 addin in VS 2010, and then debugging it as it ran in an instance of VS 2008.

    You just need to ensure the "Start external program:" entry in the Debug tab of the addin project's properties, is set to the full path for the VS 2008 version of devenv.exe. For example:

       C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

          or

    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe (if you're running on a 32bit OS).

    Just make sure that when you rebuild the addin in VS 2010 you don't target .NET 4.0. VS 2008 can't load assemblies targeting .Net 4.0.

    Sincerely,


    Ed Dore
    Friday, May 14, 2010 1:01 AM

All replies

  • Hello, again

    How do you configure the debug?

    Please follow the below steps to debug in 2008 when the add-in is in 2010.

    1.     Add the VS2008 AddIns folder to the 2010. Click “Tools”->”Options”->Expand “Environment”->Click “AddIn/Macro security”. Then click “Add” to add the 2008 addins folder, on my side is <Users>\Documents\Visual Studio 2008\Addins.

    2.     Create an add-in which target .net 2.0, Note: You could not create a .net 4.0 add-in, otherwise the add-in could not be loaded in VS2008.

    3.     After creating the add-in, right click your add-in project, click Debug panel. In the “Start external program” textbox, add the vs2008 exe path here. This is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe on my side. In Commandline argument textbox, you must ensure it is like /resetaddin AddIn20.Connect.

    4.     Then click debug, you will find the VS2008 started and it loads your add-in.

    Thanks

    Chao

     

    • Marked as answer by Chao Kuo Friday, May 14, 2010 2:49 AM
    Tuesday, May 11, 2010 10:40 AM
  • Hi Phil,

    This should be possible. I had no problem rebuilding my VS 2008 addin in VS 2010, and then debugging it as it ran in an instance of VS 2008.

    You just need to ensure the "Start external program:" entry in the Debug tab of the addin project's properties, is set to the full path for the VS 2008 version of devenv.exe. For example:

       C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe

          or

    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe (if you're running on a 32bit OS).

    Just make sure that when you rebuild the addin in VS 2010 you don't target .NET 4.0. VS 2008 can't load assemblies targeting .Net 4.0.

    Sincerely,


    Ed Dore
    Friday, May 14, 2010 1:01 AM
  • Thanks Ed, I am sure that I was doing something stupid.

    I have now split my Add-In into 3 separate versions for VS 2005, 2008 and 2010, compiled against different framework versions. In each case, I only use one debug configuration, so it is no longer an issue for me.

    Thanks nevertheless for the replies.

    Phil

    Monday, May 17, 2010 9:34 PM