locked
Need help deserializing a XAML workflow. RRS feed

  • Question

  • Hi,

    I'm trying to get an example working from A Developer's Introduction to WF4 in .NET Beta 2, and I get an error when I try to create the workflow from the xaml file.  My workflow is the one from Fig 22:

    <p:Activity x:Class="Workflows.HelloSeq" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities/design" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <x:Members>
        <x:Property Name="greeting" Type="p:InArgument(x:String)" />
        <x:Property Name="name" Type="p:InArgument(x:String)" />
      </x:Members>
      <p:Sequence>
        <p:WriteLine>[greeting &amp; " from workflow"]</p:WriteLine>
        <p:WriteLine>[name]</p:WriteLine>
      </p:Sequence>
    </p:Activity>

    And I'm creating the workflow with:

                WorkflowRuntime wr = new WorkflowRuntime();
                using (System.IO.Stream s = System.IO.File.OpenRead("Workflow1.xaml"))
                using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(s))
                {
                    WorkflowInstance wi = wr.CreateWorkflow(xmlReader);
                    wi.Start();
                }
    
    But when I call CreateWorkflow, I get a WorkflowValidationFailedException with the following single error:

    Could not deserialize object. The type 'http://schemas.microsoft.com/netfx/2009/xaml/activities.Activity' could not be resolved.

    Any ideas?

    Thanks,
    Jason
    Tuesday, December 8, 2009 8:48 PM

Answers

All replies