locked
Random System.Xaml.XamlObjectWriterException while loading or persisting workflow: Cannot create unknown type '{http://schemas.microsoft.com/winfx/2006/xaml/presentation}Point' RRS feed

  • Question

  • We are unable to nail down the exact cause for the following exception that occurs randomly in our application while loading or persisting workflows based on WorkflowApplication used within an ASP.NET MVC web-application.

    StackTrace1: Exception caused when we call WorkflowApplication.Persist

    System.Xaml.XamlObjectWriterException: Cannot create unknown type '{http://schemas.microsoft.com/winfx/2006/xaml/presentation}Point'.
     at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
     at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
     at System.Activities.XamlIntegration.FuncDeferringLoader.FuncFactory`1.Evaluate()
     at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
     at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
     at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
     at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
     at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
     at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
     at System.Activities.WorkflowApplication.EnsureInitialized()
     at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
     at System.Activities.WorkflowApplication.WaitForTurn(InstanceOperation operation, TimeSpan timeout)
     at System.Activities.WorkflowApplication.Persist(TimeSpan timeout)

    StackTrace2: Exception caused when we call WorkflowApplication.Load

    System.Xaml.XamlObjectWriterException: Cannot create unknown type '{http://schemas.microsoft.com/winfx/2006/xaml/presentation}Point'.
     at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
     at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
     at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()
     at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
     at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
     at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
     at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
     at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
     at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
     at System.Activities.WorkflowApplication.SetPersistenceManager(PersistenceManager newManager)
     at System.Activities.WorkflowApplication.CreatePersistenceManager()
     at System.Activities.WorkflowApplication.Load(Guid instanceId, TimeSpan timeout)

    Other details:

    1. All Xaml files are created using Workflow designer - thus they have mc:Ignorable attribute.
    2. Xaml files are loaded using ActivityXamlServices.Load(reader) and we are also setting LocalAssembly to the one that contains Xaml files as embedded resources.
    3. We are setting SynchronizationContext while creating WorkflowApplication so as to use ASP.NET provided SynchroniationContext.
    4. We are not calling SynchronizationContext.OperationStarted or OperationCompleted anywhere - not sure why it would be needed in this case.
    5. All our workflows use bookmarks which get persisted in InstanceStore set into WorkflowApplication using SqlWorkflowInstanceStore.
    6. We have referenced and also added in web.config assemblies section the following: WindowsBase, PresentationCore, PresentationFramework
    7. The environment is Windows 2008 Server R2 where this error is seen randomly every 2-3 days.

    Can anyone please help us resolve this exception? Not sure if it has something to do with IIS AppDomain recycling or resource leaks!

    Any help will be much appreciated.

    Thanks

    Ravi Pathak

    Friday, August 10, 2012 2:20 PM

Answers

All replies