Here are simple steps you can follow to debug any .NET code used by your BizTalk artifacts (helper code,pipeline components).
Step 1) Open the solution in Visual Studio and compile your solution in
Debug mode.
Step 2) Identify the BizTalk HostInstance running your artifacts and start the host instance. For example, if you are trying to debug a pipeline components called by Receive Location then it's host configured in the receive location. However if you are trying to debug an external assembly called by Orchestration than use Host configured in that orchestration.
Step 3) In Visual Studio select Tools-->Attach to Process--> Look for Host Instance named BTSNTSvc.exe (Tick Show process from all users) and select attach.
But what if your got multiple host configured on your machine they will all show up as BTSNTSvc.exe. In that case you need to find out the ProcessId of that host you identified in Step 2. Simply run the command from command prompt to find out the ProcessId
C:\>tasklist /svc
This will give the list of "Image Name","Process ID","Services". Search of your host name under the Services column and note down the processId. Switch back to Visual Studio
Attach to Process dialog and select the host instance with matching processId and click
Attach.
Step 4) Put a breakpoint the code and send a message through to BizTalk
Well done..you have just debugged your first BizTalk project.