如何调试Visual Studio扩展 [英] How to debug Visual Studio extensions

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

问题描述

我正在为Visual Studio 2010编写一个VSIX扩展,不知道如何调试它。

I'm just writing a VSIX extension for Visual Studio 2010 and can't figure out how to debug it.

一个明显的方法是输出消息。扩展模板使用 Trace.WriteLine()。但是在哪里找到它的输出?

One obvious method is to output messages. Extension template uses Trace.WriteLine(). But where to find it's output?

推荐答案

可以像任何其他应用程序一样调试Visual Studio Extensions。您只需要设置调试体验即可启动带有加载扩展名的devenv。尝试以下

Visual Studio Extensions can be debugged like any other application. You just need to setup the debug experience to launch devenv with the loaded extension. Try the following


  • 右键单击项目,然后选择属性

  • 转到调试选项卡

点击单选按钮开始外部程序。将其指向devenv.exe二进制文件。在我的机器上,它位于

Click on the radio button for Start External Program. Point it to the devenv.exe binary. On my machine it's located at


C:\程序文件(x86)\Microsoft Visual Studio 10.0\Common7\IDE\\ \\ devenv.exe

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

在非x64机器上,虽然可以删除(x86)部分。

On a non x64 machine though you can remove the " (x86)" portion.

然后将命令行参数设置为 / rootsuffix Exp 。这告诉Visual Studio使用实验配置单元而不是普通配置配置单元。默认情况下,VSIX扩展名将在实验配置单元中注册。

Then set the command line arguments to /rootsuffix Exp. This tells Visual Studio to use the experimental hive instead of the normal configuration hive. By default VSIX extensions when built will register themselves in the experimental hive.

现在,您可以F5,它将启动具有VSIX的Visual Studio作为可用扩展。

Now you can F5 and it will start Visual Studio with your VSIX as an available extension.

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

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