We can Debug the BizTalk Orchestrations using Orchestration Debugger or EventLogs.
Orchestration Debugger
- Create BizTalk application using Orchestration, Build and Deploy.
- Test the BizTalk application using File Drops/ SoapUI/PostMan
- Go to BizTalk Admin console and Click on BizTalk Group then Click on Tracked Service Instances
- Right click on Orchestration instance and click on Orchestration Debugger.

5. You can see two panels, left side panel is for Tracked Events and right side panel is for Orchestration.

6. In right side panel, right click on Receive shape and select “Set Breakpoint on Class F9”.

7. You can see break point is inserted on Receive shape, same way you can keep break points on required orchestration shapes.

8. Close the Orchestration instance.
9. Now repeat the step 2 above (Test the application)
10. Go to BizTalk Admin console and Click on BizTalk Group and then Click on Tracked Service Instances
11. You can see Orchestration instance with state “Started”

12. Right click on Orchestration instance and click on Orchestration Debugger.
13. Now we need to attach the Orchestration instance to break points, for that we need to hold on Ctrl key and press the letter A (Ctrl+A)

14. You can see Receive shape of the orchestration with Yellow color highlighted.
15. In order to move the control from one shape to another shape, you need to hold Ctrl button and press the letter ‘G’ (Ctrl+G)

16. Now you can see Receive shape properties in left panel bottom side, if you click on particular message or variable, you can see the result of that shape in right side below.
In the below screenshot, InputMsg is the message type assigned to Receive shape of the orchestration and result you can see in right side windows PartType and PartValue.

17. Same way you can see the result of all the orchestration shapes which are having break points.

Note: Once you are done with orchestration debugging, please remove all break points from Orchestration debugger.
EventLogs:
Using below statement in BizTalk expression shape, we can write the messages or variable values to event viewer.
System.Diagnostics.EventLog.WriteEntry(“EventName”,”Value”);
Using below code in BizTalk expression shape, we can write the orchestration input message to event viewer.
varXmlDoc = InputMsg;
System.Diagnostics.EventLog.WriteEntry(“InputMsgData”,varXmlDoc.OuterXml);
//InputMsg is the message type of the Orchestration Receive shape
//varXmlDoc is the variable of the type System.xml.xmldocument.

How to open Event Viewer?
Click on Windows StartàClick on Run


Double click on InputMsgData to view the message data.
