pikkas 0 Light Poster

I have a workflow application which i run it with WorkflowApplication command. And i am tryng to print the outputs of the workflow with the following code.

IDictionary<string, object> output = null;
          app.Completed = delegate(WorkflowApplicationCompletedEventArgs o)
            {
                    output= o.Outputs;
                    HttpContext.Current.Response.Write(output["res"]);
            };

When i run the application i get the following error on the HttpContext... line. Object reference not set to an instance of an object. But when i check the values of output in the debugger it has the correct values. How is it possible to get this error?.
Thx for your time

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.