Search code examples
visual-studiovisual-studio-extensionsvsix

Is it possible to debug VS 2019 extension from VS 2022?


I developed a VS 2019 extension using VS 2019.

When I open this project in VS 2022 and run it another instance of VS 2022 is started to install extension into.

Is there a way to use VS 2022 for coding but run VS 2019 from it for the debugging?

I also intend to have a new project in the same solution that will be a version of this extension for the VS 2022. This one will need to run VS 2022 for the debugging.


Solution

  • In VS 2019, it worked as expected. Visual Studio provided the list of supported VS versions where the extension could be debugged:

    VS 2019 start selector

    But in VS 2022, my experience is different. The selector only shows VS 2022 and starting the debugger launches VS 2022. To start VS 2019, you need to change the project properties, in Debug - Start action and explicitly select the path to VS 2019 deven.exe:

    enter image description here

    Then when you start debugging, VS 2019 instance will be launched.

    But remember that after reopening your project in VS, the path to VS 2019 in the properties is lost and it contains VS 2022 again. Maybe that's just a problem on my side, I didn't investigate further. If not, it's worth reporting to MS.