John Newell

Hello,

I am getting the following error when trying to start the work flow runtime hosted in a windows service...

Service cannot be started. System.InvalidOperationException: An instance of ExternalDataExchangeService of type TWTC.WF.WFServiceInterfaces.ITaskServiceAbstract already exists in the runtime container.

Here is my scenario

  • I need to run different, long running work flow versions side by side.
  • I have strong named assemblies, all loaded in the GAC.
  • I have the assemblies broken out by project function - data access layer, work flow, custom activities, data types, work flow local services, etc.
  • Currently loaded in the GAC are ver 1.0.0.0 of the assemblies.
  • I just added several 1.0.0.1 version of the assemblies and modified the app.config file to load the 1.0.0.1 as well as the 1.0.0.0 versions. See appconfig section below.
  • I am using xaml activation based off a custom workflow class.
  • I only start wf runtime 1x upon service startup.

Notes...

Questions...

  • Is it true that you cannot version local workflow services Or am I missing something
  • If I am correct - any plans in future workflow foundation releases to support local service versioning
  • Where can I get a list of planned releases and their content
  • If I am correct - are there any other versioning limitations to be aware of
  • If I am correct - how are you supposed to version local workflow services By deprecating method signatures, events, etc and replacing with new ones
  • If I am missing something how can I load both v1.0.0.0 and v1.0.0.1 of a local service at the same time
  • Does Microsoft have any comprehensive versioning examples that show versioning best practices

Thank You.

Here is the significant portion of my app.config.

<HostingWorkflowRuntime Name="Hosting">
<CommonParameters />
<Services>
<add type="System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" maxSimultaneousWorkflows="100" />
<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionString="Data Source=DEVSQL1;Initial Catalog=wf_persist_dev;User ID=wf_track_admin;Password=wf_track_admin;Persist Security Info=True;Application Name=WFPersistenceService;" LoadIntervalSeconds="120" unloadOnIdle="true" />
<add type="TWTC.WF.WFServices.TTrackingService, TWTC.WF.WFServices,Version=1.0.0.0, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" connectionString="Data Source=DEVSQL1;Initial Catalog=wf_track_dev;User ID=wf_track_admin;Password=wf_track_admin;Persist Security Info=True;Application Name=WFTrackingService;" />
</Services>
</HostingWorkflowRuntime>
<LocalServices>
<Services>
<!--Add local work flow services here-->
<add type="TWTC.WF.Order.WFServices.TOrderEntryServices, TWTC.WF.Order.WFServices,Version=1.0.0.0, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
<add type="TWTC.WF.Order.WFServices.TTaskServices, TWTC.WF.Order.WFServices,Version=1.0.0.0, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
<add type="TWTC.WF.Order.WFServices.TTaskIPCServices, TWTC.WF.Order.WFServices,Version=1.0.0.0, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
<add type="TWTC.WF.WFServices.TWorkflowServices, TWTC.WF.WFServices,Version=1.0.0.0, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
<add type="TWTC.WF.Order.WFServices.TOrderEntryServices, TWTC.WF.Order.WFServices,Version=1.0.0.1, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
<add type="TWTC.WF.Order.WFServices.TTaskServices, TWTC.WF.Order.WFServices,Version=1.0.0.1, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
<add type="TWTC.WF.Order.WFServices.TTaskIPCServices, TWTC.WF.Order.WFServices,Version=1.0.0.1, Culture=neutral, PublicKeyToken=50ef1afe3fe44d4e" />
</Services>
</LocalServices>

Thanks.



Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

Jon Flanders

A .NET Version # is major.minor.build.revision. Only the major and minor values matter to .NET when it comes to running assemblies side-by-side.




Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

John Newell

I tried changing version to 1.1.0.0 and received the same error.





Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

John Newell

A little clarification on my initial post...the last question in my list is in regard to workflow projects.

"Does Microsoft have any comprehensive versioning examples that show versioning best practices with regard to workflow projects "





Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

John Newell

Another wrinkle to add to this issue.

The inability to version the local workflow services is having a ripple effect. I have a versioned data type dll referenced by the local workflow services and workflows. When I rehydrate a long running workflow (version 1.0.0.0) with a v1.0.0.0 data type and it runs through some code in the local workflow service - now expecting data types v1.1.0.0 - the system throws an exception (Cannot convert type A to A).

So to work around this I am basically skipping versioning all together by using xoml activation, and being very careful how and where I make datatype changes.

Still waiting on some answers or insight by Microsoft.





Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

Dave Green - MSFT

Are you still experiencing this issue I would have expected multiple side-by-side versions of local services to work, since all WF does is to call Type.GetType passing the string you supply in the app.config, instantiate the type, and then add the instance to a collection keyed by the type. Very standard stuff. But the last of these steps appears to be failing in your case.

So please let us know if you ever got to the bottom of this

Dave






Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

John Newell

Dave,

No resolution as of yet.

As it stands now I don't see how you can version a workflow service, and load both versions so they are running side by side.

I can load 1 version or the other, but not both.

I need both because existing inflight workflows need the older version, and new workflows need the current version.

In my original post, there is a URL that contains a discussion explaining why what I want to do is not possible, and a code example - presumably .net wf code - that supports the discussion.

Hopefully I am missing something.





Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

Dave Green - MSFT

The post you cite describes a problem where workflow v1 uses local service v1, and workflow v2 uses local service v2. Both v1 and v2 of the local service can be loaded at the same time, and both v1 and v2 of the workflow can be run at the same time. The issue is that dehydrated versions of the v1 workflow cannot be rehydrated.

Is this the problem you have Much of the thread has been about whether it is possible to load two versions of a given local service assemby, which was not an issue in the earlier post.






Re: Windows Workflow Foundation Versioning local workflow services causes runtime startup error

John Newell

I don't think you have it right...If I understand you correctly.

WF cannot load both v1 and v2 of the same local workflow service at the same time...I get the error shown in my initial post....and is the main issue I am having here.

The link to the other thread in this forum contains a code sample near the end that illustrates why.