How to Force Visual Studio 2010 to debug my host executable using .NET 4.0 even if I compile my plug-in as 3.5? RRS feed

  • Question

  • Hi all.

    We have an framework for hosting 3rd party components.  Our framework is built in 3.5, but our hosting process is compiled in 4.0 to allow 3rd party componnents to take advantage of latest .NET Framework.

    We have users who would like to debug their 3.5-based components in Visual Studio.  To debug they would modify their project properties to set the "Start external program" property to the path of the Hosting executable.  Unfortunately, when they hit F5 to debug, Visual Studio decides to use the debugging engine supporting "2.0, 3.0 and 3.5" framework, which is not what's getting loaded into the Hosting executable.  And as a result, they cannot debug.    The above debugging procedure, btw, happens automatically in the code behind the VS plug-in that we wrote, so we use objects in the EnvDTE namespace to manipulate project properties and use SolutionBuild.Debug() to initiate the debugging session.

    Yes, they can detach and attach to the same process picking the appropriate debugger type,  but that's not ideal.  Is there a way to force Visual Studio to pick a proper engine?



    Friday, July 6, 2012 6:36 PM

All replies

  • Hi Feinberg,

    We can change the target framework as the follow steps: Project->Properties->Application->Target Framework, then choose the version you want.

    Or you can modify the content of .*proj. Change the target framework like:


    Best regards,

    Ego [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 9, 2012 5:00 AM
  • Yes, but we do not want to change project settings.  We still want to compile, targeting 3.5, but debug targeting 4.0.
    Wednesday, July 11, 2012 2:00 PM
  • Hi Feinberg,

    I found some references. I think you can't compile your project like it.

    Here is a FIX you can refer to:http://support.microsoft.com/kb/2591546

    Best regards,


    Thursday, July 12, 2012 9:18 AM
  • Thanks, Disley,

    this is a fix for a problem that's very much like ours, except that we are not writing VS Add-Ins, but Add-Ins into our framework.  

    Thursday, July 12, 2012 1:25 PM
  • Hi Feinberg,

    I will involve some experts into this issue to see whether they can help you out. There might be some time delay, appreciate for your patience.

    Some expert will move your thread back later.

    Thank you for your understanding and support.
    Best regards,

    Ego [MSFT]
    MSDN Community Support | Feedback to us

    • Edited by Ego Jiang Tuesday, July 17, 2012 4:32 AM
    Tuesday, July 17, 2012 4:23 AM
  • I will wait. Thank you.
    Saturday, July 21, 2012 7:32 PM
  • alex,

    Did you still encounter the issue? As far as i know, SolutionBuild.Debug() is the interface to invoke a debug session.

    Tracy YU [MSFT] MSDN Forum Support

    • Edited by tracy.yu Tuesday, August 14, 2012 7:21 AM
    Tuesday, August 14, 2012 7:20 AM