How to debug VB.NET COM+ object in VS.NET

How to debug VB.NET COM+ object in VS.NET



Just recently discovered how to debug a VB.NET COM+ object in VS.NET and thought I would share it because it was extremely helpful in debugging errors.  The key in doing this is getting process id of the dllhost.exe that you want to debug.  Follow the steps below to retrieve the process id for your COM+ application.


  1. Open Component Services
  2. Drill down to COM+ Applications under My Computer
  3. With the COM+ Applications displaying on right side of the screen, click the View menu and then make Status View the active view.
  4. Write down the number in the PID column that corresponds with your COM+ application in question.


You know have the Process ID and you need to attach your solution to that process in debug mode.  Follow the steps below to attach the solution to the Process ID.


  1. Open the Visual Studio.NET solution
  2. Make Solutions Configuration box Debug
  3. Now click the Tools menu option and choose Debug Processes menu option
  4. When the Processes box appears find the PID number from Component Services in the ID column.
  5. Highlight the row and click the Attach button.
  6. When the Attach to Process box appears then check the Common Language Runtime and Script checkboxes.  Click the OK button when finished.
  7. When the Processes screen is active again you will now see a DLLHOST.EXE in the Debugged Processes box.  The ID number should be the same as the one in the Component Service console.
  8. Close the Processes screen to return to the solution screen and the debug process should already be running.
  9. Now set a break point in your code and run the application locally.  Whenever your application reaches that break point it should stop.
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.