如何调试VSIX项目 [英] How to debug a Vsix project

查看:615
本文介绍了如何调试VSIX项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了我的项目,自定义测试运行。所以,我创建了可以在Visual Studio中注册一个测试项目VSIX

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.

我也知道,我通过F5加载扩展,那么Visual Studio中的实验实例被加载,但断点不能在Visual Studio中的实例中,我已经建立了我VSIX打击。

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?

推荐答案

我已经建立了几个Visual Studio的扩展,我从来没有发现调试VSIX的好方法。你可以启动一个实验性的实例,但我发现这是最慢的可能性

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:


  • 发展打开Visual Studio实例。加载了该解决方案。

  • 请一些变化,订做。

  • 安装.vsix(双击在\bin\debug的VSIX文件)

  • 启动Visual Studio中的一个新实例进行测试

  • 在开发的Visual Studio,调试 - >附加到进程,然后选择 devenv的。 exe文件

  • 在开发Visual Studio中,设置一些破发点。

  • 在测试Visual Studio中,创建/打开新的解决方案,并开始测试编码。

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

我发现这是不是启动了VS的实验实例快得多。但它仍然是相当艰巨的。

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

其他的事情我强烈建议,是抽象的尽可能多的Visual Studio的API,你可以做单元测试和做只是最低限度的在Visual Studio的测试。例如,在一个项目中,我的工作现在, pMixins ,我抽象出来Visual Studio的事件系统(的 VisualStudioEventProxy ),使我的基础设施不具有对事件API硬依赖性,我可以写一个测试,模拟的事件。

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.

这篇关于如何调试VSIX项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆