Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a managed BHO from Visual Studio 2010

I've a managed Explorer Bar (working in Internet Explorer) that is working reasonably well. Currently, the only way to debug it:

  1. Start IE outside VS
  2. From VS (Debug => Attach) Attach to the process "iexplore.exe"

Trying to do the following:

  1. Go to Project Properties => Debug tab
  2. Start External Program: c:\program files (x86)\internet explorer\iexplore.exe
  3. Command line argument: about:blank
  4. Hit F5

The first method is very cumbersome. With the second method, iexplore starts, but the debugger doesn't recognize the breakpoints, don't know why.

Any tip?

like image 601
Uri Avatar asked Dec 25 '11 14:12

Uri


1 Answers

So ... 3 months after I opened this question, here is the answer. In Visual Studio, open an EXE as a new project:

  1. File -> Open -> Project/Solution
  2. Change type to exe file
  3. Open c:\program files\internet explorer\iexplore.exe

then, open project property:

  1. There is only one 'General' tab
  2. Change Debugger Type to 'Managed v4.0'

That's it. F5 will now work. You can add this EXE project to the solution that contains your managed bho, and set the EXE project to be the Startup project.

like image 186
Uri Avatar answered Sep 30 '22 14:09

Uri