WorkflowMarkupSerializationException at SqlTrackingWorkflowInstance at WorkflowDefinition
I am currently use the SqlTrackingService to track my workflows. Then I tried to read the tracking information out of the database. First of all I wanted to get the WorkflowDefinition to read some meta information about the workflow via reflection. But when I try to read the WorkflowDefinition Property in my SqlTrackingWorkflowInstance instance, I get the following exception: WorkflowMarkupSerializationException "Failed deserializing workflow markup. Make sure all necessary types are available.".
I checked and did not found any missing assembly in my AppDomaion. If I access the SAME property "WorkflowDefinition", it works! Why do I get this exception in the first place?
Here is the code snippet:
SqlTrackingWorkflowInstance tracking;
if (_sqlTrackingQuery.TryGetWorkflow(workflowInstanceId, out tracking))
{
try
{
Activity a = tracking.WorkflowDefinition;
}
catch (WorkflowMarkupSerializationException ex)
{
//Exception happens here
TracingLoggingStatic.DebugWriteLine(ex.Message, AUVA.EFEU.Common.SystemLibrary.LogCategory.Trace);
}
//NO exception, works just fine.
Activity b = tracking.WorkflowDefiniton;
Any help appreciated. I am currently working on a project on an important customer and should get this running in time.
Thanks!
Gerald
From your description I don't understand the usage difference between the line that throws and the line that doesn't. The only difference in your code snip is the name of the variable. In the case that doesn't throw, what are you doing differently? Is the your "tracking" variable the same in both case? Does the "tracking" variable represent the same workflow instance (same workflow instance id guid)? Is the code in the successful case run in the same app domain? What build are you using? If it's not the July CTP please upgrade and try the scenario again.
Thanks,
Joel West
MSFTE - SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights
Hi! First of all: Thanks for your fast response!
The interesting thing is: There is no difference, but the first time I get the exception, the second time, I don't. The variable could be the same also, it makes no difference, also the tracking variable is the same instance and represents the same workflow. The property "WorkflowDefinition" throws the first time the exception, but after catching this exception and accessing again the property "WorkflowDefinition" it just works fine.
I am currently using an internal build from Microsoft called Release Candidate 4. But I also tried this with previous versions.
I am also wondering how I could get more information about the exception, but there isn't.
Thanks,
Gerald Tauchner
MSFTE - Information Worker Consultant / Austria