locked
XAML Node Stream: Missing CurrentObject before EndObject. RRS feed

  • Question

  • I am new in Workflow Foundation and I have created a simple WF sequence in WF 4.

    I have tested the workflow using a console application and calling it using both WorkflowApplication and WorkflowInvoker and it works fine.

     

    I then try doing the same from an apsx page and I get an XAMLObjectWriterException:

    'XAML Node Stream: Missing CurrentObject before EndObject.' Line number '2' and line position '73'.

       at System.Xaml.XamlObjectWriter.WriteEndObject()

       at System.Xaml.XamlObjectWriter.Dispose(Boolean disposing)

       at System.Xaml.XamlWriter.System.IDisposable.Dispose()

       at OrderWF1.NewOrderWorkflow.InitializeComponent() 

       at OrderWF1.NewOrderWorkflow..ctor() 

       at OrderWF1.OrderProcessHost.CreateOrder(Order order)

     

    I get the same error in both occasions (WorkflowApplication and WorkflowInvoker)

    I haven't got the slightest idea what is wrong.

    Any help will be greatly appreciated...

     

    Thursday, June 3, 2010 12:10 PM

Answers

  • Hi,

    The code seems good, without the workflow definition and Your customized Tracking Participant. I cannot repro it in my computer.
    You can set some break points and debug this program to find out which part of your code throw out the exception.

    If you can paste workflow code and TrackingParticipant here (or mail to me: xhinker[at]hotmail.com). I will test it.  

    I also find this thread, which could be helpful to you:
    http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/281e55a9-cfe8-47e3-acc3-a93d850b3eb0

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    • Marked as answer by Andrew_Zhu Thursday, June 10, 2010 12:55 AM
    Monday, June 7, 2010 8:40 AM

All replies

  • Hi,

    Could you paste your code here.
    ->"I then try doing the same from an apsx page and I get an XAMLObjectWriterException:"
    You can try run the asp.net site under a administrator account(shift the identity of application pool to a administrator account).

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    Monday, June 7, 2010 6:49 AM
  • I changed the application pool to an administrator account but I still get the error.

    Here's some code:

    OrderProcessHost host = new OrderProcessHost();
    host.CreateOrder(Order);

    public class OrderProcessHost : IOrderProcessHost
    	{
    		#region IOrderProcessHost Members
    
    		public WorkflowApplication CreateOrder(Order order)
    		{
    
    			using (UnitOfWork.Start())
    			{
    
    				// input parameters for the WF program
    				IDictionary<string, object> inputs = new Dictionary<string, object>();
    				inputs.Add("NewOrder", order);
    
    				// create and run the WF instance
    				Activity wf = new NewOrderWorkflow();
    				WorkflowApplication instance = new WorkflowApplication(wf, inputs);
    
    				// add a tracking participant
    				instance.Extensions.Add(new SaveAllEventsToTestFileTrackingParticipant());
    
    				AutoResetEvent syncEvent = new AutoResetEvent(false);
    
    				// Handle the desired lifecycle events.
    				instance.Completed = delegate(WorkflowApplicationCompletedEventArgs e)
    				{
    					syncEvent.Set();
    				};
    
    				// Start the workflow.
    				instance.Run();
    
    				// Wait for Completed to arrive and signal that
    				// the workflow is complete.
    				syncEvent.WaitOne();
    
    				return instance;
    			}
    		}
    }

    If execute the exact same code in a console application, everything works fine.
    Monday, June 7, 2010 7:28 AM
  • Hi,

    The code seems good, without the workflow definition and Your customized Tracking Participant. I cannot repro it in my computer.
    You can set some break points and debug this program to find out which part of your code throw out the exception.

    If you can paste workflow code and TrackingParticipant here (or mail to me: xhinker[at]hotmail.com). I will test it.  

    I also find this thread, which could be helpful to you:
    http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/281e55a9-cfe8-47e3-acc3-a93d850b3eb0

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support
    • Marked as answer by Andrew_Zhu Thursday, June 10, 2010 12:55 AM
    Monday, June 7, 2010 8:40 AM
  • Hi,

    Were you able to resolve this issue?  If so, please let me know what you did to resolve it...

    I have a workflow (xaml) that I'm calling from a WCF service using a WorkflowHostingEndpoint.  When I try to instantiate the WorkflowServiceHost in a Console application, I get the following error:

    "The invocation of the constructor on type '...Subprocesses.CustomerProcess' that matches the specified binding constraints threw an exception."

    The inner exception is: 'XAML Node Stream: Missing CurrentObject before EndObject.' Line number '160' and line position '54'.

    The workflow compiles fine and I don't receive any intelligible error messages that can help me find the root cause.  I've looked at several forums and can't really find a solution to this issue...

    I'd appreciate any help you can give.

    Thanks!


    Thanks, KBW
    Monday, January 30, 2012 4:11 AM
  • The two occasions I encountered this error the root cause of the problem was and exception in the constructor of a class called within the workflow...

    The problem is the InnerException is so cryptic it's not easily traceable without removing activities from the workflow until reaching the problem activity (or variable)...

    I hope this helps someone else who get caught in this cycle to save a couple of days of their time.


    Thanks, KBW
    Wednesday, February 1, 2012 1:51 AM
  • This error can be corrected by removing the following tags in web.config:

    In the key <system.web> remove these lines:

      <httpRuntime maxRequestLength="9000"> </ httpRuntime>
      <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
    Friday, April 13, 2012 11:29 AM