How to debug a Vsix project
Asked Answered
I

2

22

I'm creating a custom test runner for my project. So I've created a test vsix project which can be registered in Visual Studio.

I also knows that I load the extension through F5, then the experimental instance of Visual Studio is loaded, but breakpoints are not hit in the Visual Studio Instance in which I've created my vsix.

Someone knows how to really debug it?

Inhumane answered 9/7, 2014 at 12:17 Comment(5)
The way you debug it, is the same what you essentially do. Eg press F5 through experimental instance. Rebuild the solution, get rid of old debug symbols, clear all the caches(12.0Exp registry, 12.0Exp AppData folder)Hootenanny
@Inhumane - Did you find a good solution for this?Landgravine
Unfortunately, I didn't.Inhumane
Possible duplicate of How to debug Visual Studio extensionsGrochow
@Erti-Chris Eelmaa, it worked for me, thank you a lotKiernan
L
20

I've built a few Visual Studio extension and I've never found a good way to debug a VSIX. You can launch an experimental instance, but I've found this to be the slowest possibility.

This is the workflow I use:

  • Open a Visual Studio instance for development. Load up the solution.
  • Make some changes, build.
  • Install the .vsix (double clicking the vsix file in \bin\debug)
  • Launch a new Instance of Visual Studio for testing.
  • In the Dev Visual Studio, Debug -> Attach to Process and select devenv.exe
  • In the Dev Visual Studio, set some break points.
  • In the Test Visual Studio, create / open new solution and start test coding.

I've found this to be much faster than launching the VS Experimental Instance. But it's still quite arduous.

The other thing I highly recommend, is to abstract as much of the Visual Studio API as you can do unit testing and doing only the bare minimum of testing in Visual Studio. For example, in a project I'm working on now, pMixins, I've abstracted out the Visual Studio event system (VisualStudioEventProxy) so that my infrastructure doesn't have a hard dependency on the event api, and I can write a test which simulates events.

Landgravine answered 21/7, 2014 at 8:44 Comment(0)
C
16

A bit late, but may be helpful for others.

A suggestion I found here helped me to resolve my problem with debugging my .vsix component in VS2012. In short: add to project properties "start external program:" [your visual studio path], add to "Command line arguments" /rootsuffix Exp.

Curtsey answered 3/2, 2016 at 19:58 Comment(1)
The website of the link is broken.Runny

© 2022 - 2024 — McMap. All rights reserved.