Adsense

Sunday, March 04, 2007

Debugging ActiveX Controls in VS2005 (Attaching To a Process)

I already wrote a post about creating ActiveX controls in Visual Studio 2005. To make life a bit easier, I'm going to tell you how you can debug an ActiveX control that you have built and embedded into your web page.

I deployed my web page to IIS and then bring it up in the browser (http://localhost/ActiveXTest/Default.aspx.) Once you have the page up and can see your ActiveX control, switch to Visual Studio and click on the 'Debug' menu item. Click on 'Attach to Process'.

On the Attach to Process screen, click on 'Select...' next to the Attach to: label. Select Managed Code and click on 'OK'. In the Available Processes section, select 'iexplore.exe' and click on 'Attach'.

That's all there is to it! You should now be able to place break points into your control and debug. (Assuming that there are no issues with your implementation that would prevent you from even getting to the control.)

1 comment:

Ami Brazen said...

First time reading this blog, thanks for sharing