Troubleshooting CS pipeline components are a bit like stumbling around in the dark, you may find your way, but if the lights were on, it would be easier. Recently I found myself trying to troubleshoot a an order property that I knew I was setting but couldn’t read. I combed through the log files and set the debugger but I still could not find the issue. I found this post from CS 2002 and I decided to build it as a pipeline component that I could plug into my pipeline to try to see what was going on. I’ve omitted a lot of the generic pipeline code like the attributes, namespace, etc.. If you want that stuff, you see Max Akbar’s or Collin Bowern’s Blog.


using Microsoft.CommerceServer.Runtime.Diagnostics;


public const int Success = 1; //OPPERRORLEV_SUCCESS
public const int Warning = 2; //OPPERRORLEV_WARN
public const int Error = 3; //OPPERRORLEV_FAIL
private const String ProgId = "PipelineComponents.DumpOrderForm";

protected override int ExecuteInternal(object pdispOrder, object pdispContext, int lFlags)

IDictionary context = (IDictionary)pdispContext;
IDictionary orderForm = (IDictionary)pdispOrder;
StringWriter textWriter = new StringWriter();

System.Web.UI.HtmlTextWriter output = new System.Web.UI.HtmlTextWriter(textWriter);
DumpUtils.DumpDictionary(orderForm, output, "OrderForm");
DumpUtils.DumpDictionary(context, output, "Context");

string dumpDictionariesAsHtml = textWriter.ToString();
return Success;


private void writeToLog(string textToWrite)

string path = @HttpRuntime.AppDomainAppPath + @"pipelines\log\";
string fileName = ProgId + "-" + DateTime.Now.ToFileTime().ToString() + ".html";
// Create a file to write to it
using (StreamWriter sw = File.CreateText(Path.Combine(path, fileName)))


With this tool and the output, I was able to see that my value was indeed not there when the pipeline execution was complete. I ran through it again and I found the issue. I was not calling Basket.Save at the end of the pipeline (dooh!). Fixed that issue now on to the next.