locked
Custom Tracking Service has stopped working RRS feed

  • Question

  • Hi All,

    I have a custom tracking service that has been running for a while now with over 1500 live workflows ticking along, I'm now in the process of versioning the workflows so that I can release some change requests.

    Unfortunately the system was not initially deployed with strongly typed assemblies, so I'm in the process of sorting this mess out.

    I'm having to use a mixture of a custom SerializationBinder to translate the PublicKeyToken=null to my new PublicKeyToken, and a AppDomain_AssemblyResolve delegate to help point the host to the now strongly typed assemblies.

    I've also had to replace the contents of the related rows within the [Type] table that comes with the default SqlTrackingService to reference the new PublicKeyToken, so:

    some.namespace.foobar, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 
    is replaced with:
    some.namespace.foobar, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789acb


    I seem to be making good progress, however when I transition my State Machine workflow, the Custom Tracking Service that I have added as a service is no longer firing for version 1.0.0.0 workflows, but is working for newly created version 2.0.0.0 workflows.

    Note: The default SqlTrackingService is still running fine on both versions of the workflow, this is just a problem with the custom tracking service.

    The Custom Tracking Service has always been added through the app.config like this:

     

    <Services>
           ...other services here...
          <add type="some.namespace.ActiveStateTrackingService, some.namespace.extensions" assembly="uk.gov.gsi.cma.extensions" />
    </Services>
    

     

     

    Any ideas on what else I need to change to get this working for the already existing workflows?

     

    just a though: could it be anything to do with the way the assembly is referenced in the above code, should it include the full strongly typed details and version? And if so, has the tracking profile stored the original value somewhere that I would need to change?




    • Edited by Tr1stan Tuesday, November 8, 2011 12:18 PM more info
    Friday, November 4, 2011 6:01 PM

Answers

  • Have you tried this KB?

    http://support.microsoft.com/kb/956630


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Xin Ji - MSFT Friday, December 9, 2011 2:51 AM
    • Marked as answer by Tr1stan Wednesday, December 28, 2011 12:44 PM
    Thursday, December 8, 2011 4:30 AM

All replies

  • Hi,

    Is it possible that the metadata of version 1.0.0.0 workflow instance already loaded in memory, so only newly created workflows will fire the service.

    See if dynamic update workflow samples helps

    http://msdn.microsoft.com/en-us/library/ms742040(VS.90).aspx

    Monday, November 7, 2011 8:52 AM
  • Hi Franconia, thanks for taking time to help me.

    The newly created workflows are at version 2.0.0.0, and new tracking profiles are created for these new workflows.  I'm guessing it is for this reason that the new workflows don't have issues with the custom tracking service because their tracking profiles are generated from the new Strong Named assemblies.

    The particular workflows I'm talking about are no longer in memory because they've been persisted, awaing a delay timer or manual intervension from a user, I can confirm whey have been unloaded.

     

    Monday, November 7, 2011 3:42 PM
  • Hi,

    "Making changes to an assembly name or type definition that is used by a persisted object will cause deserialization problems"

    Overriding Deserialization of Persisted Workflow Instances

    http://www.eggheadcafe.com/tutorials/wcf/40fe2b27-ef79-45d0-82e1-6eca3ed67df8/overriding-deserialization-of-persisted-workflow-instances.aspx

    Here is a discussion about using assembly version to handler this.

    Workflow serialization and system upgrades

    http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/thread/a9b9821e-321e-42d8-9385-ab1d5af871f6

    Hope this helps.

    Tuesday, November 8, 2011 6:02 AM
  • Thanks,

    I have been following the eggheadcafe resource to get where I've got a solution where everything but the Custom Tracking Service works for already persisted workflows. What I'm finding hard to get to the bottom of is that there is no issues with the default SqlTrackingService, that is running and tracking without a problem. The issue I've got is that the Custom Tracking Service isn't getting called.

    I can't seem to find any methods to override to fix the issue with the custom tracking service and the fact that the workflow persistence has a reference somewhere with the old assembly name.

    This guy had exactly the same problem, although his solution doesn't apply to me, because I've not changed the LoadIntervalSeconds attribute between releases.

    I'm getting so frustrated :/

     

    Tuesday, November 8, 2011 1:12 PM
  • **Bump**

    So there must be some internal comparison of the loaded custom tracking services and that of the workflow that is being loaded from memory (deserialised), these aren't matching because of the changes to the assembly name and therefore no events are being tracked.

    Does anyone have any experience on how I might get some support on this matter from Microsoft, I've never been in a situation where I can't get a problem resolved before, does one pay for a Microsoft engineer to look at the problem with you? 

     

    Monday, November 28, 2011 10:08 AM
  • Have you tried this KB?

    http://support.microsoft.com/kb/956630


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Xin Ji - MSFT Friday, December 9, 2011 2:51 AM
    • Marked as answer by Tr1stan Wednesday, December 28, 2011 12:44 PM
    Thursday, December 8, 2011 4:30 AM
  • Xin Ji, 

    This indeed did solve my problem with the translation of the old>new tracking service, thank goodness you're about to give advice.

    Tristan

    Wednesday, December 28, 2011 12:45 PM
  • Me again,

    So after firing off a bunch of tests across multiple but unique workflows that I have running in the system, this all seemed to be running without a problem, what I hadn't tested was running multiple versions of the same workflow type, because I didn't think this would ever be a problem. I was wrong.

    See here: http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/thread/cfe679eb-5081-4c3d-b448-e9abe9ef4815

    • Edited by Tr1stan Monday, January 9, 2012 11:45 AM shouldn't hijack my own post
    Sunday, January 8, 2012 12:20 AM