How to debug a Visual Studio .NET 2005 Add-In

In Visual Studio .NET 2002 and Visual Studio .NET 2003, you were required to register add-in assemblies with Windows as COM components by using the Assembly Registration Tool (regasm.exe). Also, you were required to register the add-in with Visual Studio by using keys in the Windows registry before the add-in would appear in the Add-In Manager.

These steps have changed in Visual Studio 2005. You no longer need to register the .NET assemblies with Windows by using regasm. Instead, you simply place the assembly .DLL file into a specific directory along with an XML file that has an .Addin file extension. This XML file describes the information that Visual Studio requires to display the add-in in the Add-In Manager. When Visual Studio starts, it looks in the .Addin File location (listed below) for any available .Addin files. If it finds any, it reads the XML file and provides the Add-In Manager with the information needed to start the add-in when it is clicked.

This simplified registration method allows XCopy-style installations for managed code add-ins. If you put all the files in the right place, then your add-in works just fine. Also, its use of commented XML to define the registration settings for add-ins allows the information to be more easily understood and edited than registry keys.


Application Configuration

However for debugging an add-in you have to one other thing. In the Debug tab you have to select an external program which will start a new development environment . This application can handle command-line arguments. The argument for resetting an add-in is resetaddin which expects a full class name.


Debug Configuration

The following is an example of a complete .Addin XML file. The .Addin file is usually placed at /Documents and Settings/All Users/My Documents/Visual Studio 2005/Addins or /Documents and Settings/<user name>/My Documents/Visual Studio 2005/Addins. The Assembly node (in bold) specifies the location of the (debug) add-in binaries. This field can be set to a local path, a network path, or a valid URL.

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
  <HostApplication>
    <Name>Microsoft Visual Studio</Name>
    <Version>8.0</Version>
  </HostApplication>
  <Addin>
    <FriendlyName>w00t</FriendlyName>
    <Description>w00t</Description>
    <Assembly>[Path to add-in]/w00t.dll</Assembly>
    <FullClassName>MGlaser.Tools.w00t.Connect</FullClassName>
    <LoadBehavior>1</LoadBehavior>
    <CommandPreload>0</CommandPreload>
    <CommandLineSafe>0</CommandLineSafe>
  </Addin>
</Extensibility>
w00t - For Testing.AddIn

Summary
It's really easy to debug an add-in these days. The reason why I want to show you this cause one of mine w00test add-ins doesn't work in mine virtual PC images. I hope to bring you the good news tommorow if I was able to extend this add-in, so it can work on a VPC as well.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值