问题
I've a managed Explorer Bar (working in Internet Explorer) that is working reasonably well. Currently, the only way to debug it:
- Start IE outside VS
- From VS (Debug => Attach) Attach to the process "iexplore.exe"
Trying to do the following:
- Go to Project Properties => Debug tab
- Start External Program: c:\program files (x86)\internet explorer\iexplore.exe
- Command line argument: about:blank
- 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?
回答1:
So ... 3 months after I opened this question, here is the answer. In Visual Studio, open an EXE as a new project:
- File -> Open -> Project/Solution
- Change type to exe file
- Open c:\program files\internet explorer\iexplore.exe
then, open project property:
- There is only one 'General' tab
- 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.
来源:https://stackoverflow.com/questions/8629976/how-to-debug-a-managed-bho-from-visual-studio-2010