Home » Windows OS

Non-Service workflows in AppFabric

Is it possible to host non-service workflows in AppFabric?

18 Answers Found


Answer 1

Hi Jaspreet,

No. AppFabric deals with IIS hosted WCF and WF services. In the case of WF, these are workflows  that are exposed as WCF services.


Answer 2


Going through the article http://msdn.microsoft.com/en-us/library/ee358748(VS.100).aspx, it seems possible to host non-service  workflow in appfabric  using WorkflowServiceHost extensibility feature.

Though I understood the post and it works fine for self-hosted scenario, I am unable to get handle of WorkflowServiceHost in AppFabric. Sees I will have to add extensions in web configuration file. Need some help to take this further.


Answer 3

Jaspreet, when you host  a service in IIS you use the WorkflowServiceHost, either the default one or one that you build by deriving from WorkflowServiceHost. WorkflowServiceHost exposes the workflow as a service; the workflow talks to the outside world via WCF services.

Give us more details about what you're trying to do. What does "I'm unable to get handle of WorkflowServiceHost in AppFabric" mean? What are you trying to do?


Answer 4


 I could get non-service  workflow (pure XAML with no message shape + SVC file) work in appfabric  using custom WorkflowServiceHostFactory.

Thanks for your help!

Answer 5

Hi Jaspreet,

I am also thinking of where to host  my new wf4.0 based workflows.As appfabric  is going to come and seems to be a good appserver, want to host my non service workflow in appfabric.
Good to know from your post that you are able to achieve this.
Can you please share some sample or steps on how you achieved this and what were the main bottlenecks.


Answer 7

Hi Jaspreet,
hi Thompson,

I am very interested in hosting non-service  workflows in AppFabric, too. Can you please share your solution to this with us?



Answer 8

Have you seen the following topic?

How to: Host a non-service  workflow in IIS




Answer 9

Yes, but it's quite confusing.

The introduction says the article will show a way how to host workflows  in IIS that are not workflow services. So it starts with creating a simple workflow (section "Create a simple workflow") in a Console Application project. By following these steps you will get a workflow based on the Activity-Class (which has an <Activity> element as root node in the XAML).

If you follow the further steps it comes to the point where you test the endpoint by opening its URL in Internet Explorer. This fails with a 404. If you try the following steps and create a client that will call the endpoint, it also fails with an Exception, containing a 404. The sample seems not working so far.

If you now scroll a bit deeper, there is a section "Example", containing the complete code for this sample. If you look at the code for Workflow1.xamlx, you will recognize that this workflow is based on a <WorkflowService> root activity in contrast to the sample workflow we created in the beginning (which is based on <Activity>). If you now try to run the sample with this new "Worklflow1.xamlx" code, it works. Nice, but this is a workflow based on WorkflowService, which is no  non-service  workflow for me.

The article suggests that it's possible to host  normal <Activity> based workflows in IIS. I have tried several simple workflows, but only <WorkflowService> based workflows work with this sample. Every "normal" workflow leads to a 404 error.

I'm looking for a solution to host simple workflows in IIS and appfabric  just like they are created when you drag a few activities onto the workflow designer surface and save the XAML to a file. I don't want the user to have to add a <WorkflowService> node or something like that.



Answer 10


I have gone through the topic and tried to make it a bit clearer and made serveral fixes to the code.  I have placed the updated topic in a Word doc for you to look at here: http://cid-dbe3afde8f12ca0d.office.live.com/browse.aspx/HostingNonService?Bsrc=EMSHOO&Bpub=SN.Notifications Please let me know if this makes more sense to you. One additional thing is the Workflow1.xamlx still has a root element of type <WorkflowService>. While the element is "WorkflowService" there are no Receive or Send activities in it, and therefore it is treated as a regular (non-service) workflow. The WorklflowService element is our tie-in to IIS, but I believe you can use a workflow that has an Activity element as the root, but it needs to be compiled to an assembly (it cannot be read in from a XAMLX file).  I will do some more research and see if I can get that to work.

I hope this information is helpful, and please let me know if you would like to see further changes in this doc.


Michael Green [MSFT]


Answer 11

Thanks a lot Michael,

I have looked over your Word doc and it makes more sense now.

It would be very interesting to hear more about hosting workflows  that have Activity root elements. Because it's a bit awkward to instruct the user of the designer that he has to create a WorkflowService, remove the Send and Receive activities, and so on.

Looking forward to hearing from you,



Answer 12

In .Net 3.5, you were able to use page flow to interact with a workflow by passing the instance along with the session state, but AppFabric makes this unneccesary and not recommended-

Answer 13


I've worked through the example in your document and I'm able to execute the non-service  workflow as you described.  However, I'd like to have a workflow executed on IIS startup using the AppFabric auto-start feature.  Specifying the relativeVirtualPath="Workflow1.xamlx" doesn't seem to actually start the workflow.  Is this possible?





Answer 14


I have gone through the topic and tried to make it a bit clearer and made serveral fixes to the code.  I have placed the updated topic in a Word doc for you to look at here: http://cid-dbe3afde8f12ca0d.office.live.com/browse.aspx/HostingNonService?Bsrc=EMSHOO&Bpub=SN.Notifications Please let me know if this makes more sense to you. One additional thing is the Workflow1.xamlx still has a root element of type <WORKFLOWSERVICE>. While the element is "WorkflowService" there are no Receive or Send activities in it, and therefore it is treated as a regular (non-service) workflow. The WorklflowService element is our tie-in to IIS, but I believe you can use a workflow that has an Activity element as the root, but it needs to be compiled to an assembly (it cannot be read in from a XAMLX file).  I will do some more research and see if I can get that to work.</WORKFLOWSERVICE>

I hope this information is helpful, and please let me know if you would like to see further changes in this doc.


Michael Green [MSFT]


It's helpful to me, Thanks for your analysis!

Answer 15


I am very sorry for the delay in getting back to you. I did take some time to look into hosting a non-service  workflow that is based off of an Activity in IIS. It turns out that you don't need to compile the activity. Please take a look at a sample here: http://cid-dbe3afde8f12ca0d.office.live.com/browse.aspx/NonServiceWorkflowWithActivity?Bsrc=EMSHOO&Bpub=SN.Notifications and let me know if you have any further questions.

Again I am very sorry it took so long to get back to you.

Michael Green [MSFT]


Answer 16

This is exactly what I was looking for. Thank you very much, Michael! This helps a lot.



Answer 17

Hi Michael,

I'm having a problem passing arguments to the workflow.

In CreationEndpoint.OnGetCreationContext() I added two <string, object> values to the creationContext.WorkflowArguments collection, containing name and value for the workflow's arguments (eg Argument1, Argument2).

Executing the workflow leads to the following exception:
The values provided for the root activity's arguments did not satisfy the root activity's requirements:
'DynamicActivity': The following keys from the input dictionary do not map to arguments and must be removed: Argument1, Argument2.  Please note that argument names are case sensitive.
Parameter name: rootArgumentValues

How do I get the input dictionary into my workflow definition contained in the DynamicActivity?



Answer 18

Refer to this article to host a non service workflow - http://msdn.microsoft.com/en-us/library/ff729688.aspx

To AutoStart the WF- there are several ways, one of which is by using the Application Warmup Module to call the Creation Endpoint  http://www.iis.net/download/applicationwarmup

I haven't come across a way to do this just alone with AppFabric.





Is it possible to host non-service workflows in AppFabric?

I am running cluster machine in Virtual Box in domain, by default service is running under Network service , i am also receiving  same error

please find the error details from error log below. any help will be great.

Log Name:  System
Source:  Service Control Manager
Date:   21-07-2010 16:42:07
Event ID:  7034
Task Category: None
Level:   Error
Keywords:  Classic
User:   N/A
The AppFabric Caching Service service terminated unexpectedly. It has done this 5 time(s).
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
 <Provider Name="Service Control Manager" Guid="{555908D1-A6D7-4695-8E1E-26931D2012F4}" EventSourceName="Service Control Manager" />
 <EventID Qualifiers="49152">7034</EventID>
 <TimeCreated SystemTime="2010-07-21T14:42:07.000Z" />
 <Correlation />
 <Execution ProcessID="0" ThreadID="0" />
 <Security />
 <Data Name="param1">AppFabric Caching Service</Data>
 <Data Name="param2">5</Data>





i need to start different workflows (stored as xaml file in a database) based on some business events, publishing them as wcf services and being able to call them individually.  So i'm loading the xaml at runtime, i create the WorkflowServiceHost object and feed it with my custom wcf binding (unique path based on a business entity key) and then i Open() it.

It actually works but the endpoint/service/wf doesnt show up in appfabric dashborard, so i miss all those addictional centralized features.

 I read that's not supported out of the box: http://social.technet.microsoft.com/wiki/contents/articles/appfabric-faq-hosting.aspx 

"Q: I am dynamically creating endpoints within my WCF AppFabric service, yet they do not show up in the Endpoints dialog.
A; AppFabric only displays endpoints that are explicitly defined in configuration files. AppFabric does not show the endpoints that are defined in code or those (such as the service endpoint and workflow control endpoint) that are assumed by the runtime.

 How can i achieve this feature with some code ?

Thanks, Valerio


I have been trying, and failing, to populate an AppFabric Cache from within an AppFabric Workflow (hosted within ASP.NET Development Server during debugging). I trigger the workflow and then attempt to instantiate a collection the wraps a DataCache. At the point where I try to instantiate a the DataCacheFactory (in order to subsequently create a DataCache) using the following code:

public CacheKeyedCollection(string cacheName, string region)
    DataCacheServerEndpoint[] endpoints = new DataCacheServerEndpoint[] { new DataCacheServerEndpoint("localhost", 22233, "DistributedCacheService") };

    using (DataCacheFactory factory = new DataCacheFactory(endpoints, true, false))  <- Exception
        m_cache = factory.GetCache(cacheName);

    m_region = region;
... I get the following error:
Microsoft.Data.Caching.DataCacheException was unhandled by user code
  Message=ErrorCode<ERRCA0022>:SubStatus<ES0006>:There is a temporary failure, please retry after some time. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. Please ensure security permission has been granted for this client account on cluster and ensure that cache service is allowed through firewall on all cache hosts. Retry later)
       at Microsoft.Data.Caching.DataCacheFactory.Initialize()
       at Microsoft.Data.Caching.DataCacheFactory.CreateCacheFactory(EndpointID[] servers, Boolean routingClient, Boolean localCache, DataCacheLocalCacheSyncPolicy syncPolicy, Int32 localCacheTimeout, Int32 pollInterval, Int64 objectCount, Int32 masterTimeout, TimeSpan channelOpenTimeout, DataCacheSecurity dataCacheSecurity)
       at Microsoft.Data.Caching.DataCacheFactory..ctor(DataCacheServerEndpoint[] servers, Boolean routingClient, Boolean localCache)
       at SolutionForge.FixnetTrader.Services.Analytics.CacheKeyedCollection`1..ctor(String cacheName, String region) in C:\Source\SolutionForge\Order Manager\4.8\Product\Services\Analytics\Analytics\SolutionForge.FixnetTrader.Services.Analytics\CacheKeyedCollection.cs:line 18
       at SolutionForge.FixnetTrader.Services.Analytics.OrderCollection..ctor(String cacheName, String region) in C:\Source\SolutionForge\Order Manager\4.8\Product\Services\Analytics\Analytics\SolutionForge.FixnetTrader.Services.Analytics\CacheKeyedCollection.cs:line 65
       at lambda_method(Closure , ActivityContext )
       at Microsoft.VisualBasic.Activities.VisualBasicValue`1.GetValueCore(ActivityContext context)
       at Microsoft.VisualBasic.Activities.VisualBasicValue`1.TryGetValue(ActivityContext context, TResult& value)
       at System.Activities.InArgument`1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityContext resolutionContext)
       at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityContext resolutionContext, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
       at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary`2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
       at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Now, the ASP.Net Development Server is running under my user account from which I am able to maintain the cache using powershell so I would assume its not a permissioning error but I tried "Grant-CacheAllowedClientAccounts" using both "account" and "domain\account" patterns to no avail.

Is anyone else getting this error? I've been banging my head against it for a while now...



Based off some work we did on a customer project we put together this blog post to demonstrate use of AD FS 2.0 to secure WCF/WF Services hosted on Windows Server AppFabric.

The article is posted at our team blog site: http://blogs.msdn.com/b/appfabriccat/archive/2010/12/14/ad-fs-2-0-to-secure-wcf-and-workflow-services-hosted-in-windows-server-appfabric.aspx?wa=wsignin1.0

Do provide feedback.



Based off some work we did on a customer project we put together this blog post to demonstrate use of AD FS 2.0 to secure WCF/WF Services hosted on Windows Server AppFabric.

The article is posted at our team blog site: http://blogs.msdn.com/b/appfabriccat/archive/2010/12/14/ad-fs-2-0-to-secure-wcf-and-workflow-services-hosted-in-windows-server-appfabric.aspx?wa=wsignin1.0

Do provide feedback.




I think I have a straightforward question. If my workflow has no messaging activities, it will have no (service) contract? Therefore the only way for me to communicate with it is using a WorkflowHostingEndpoint for interaction and the WorkflowControlEndpoint for instance management. Is this correct or am I missing anything? Can I give my workflow an empty contract so I can tie to a WCF service definition or is that just rubbish.

The reason for the question is that I want to take full advantage of AppFabric. I have a prototype that uses the dynamically created endpoints for the workflowservicehost as suggested above, but I don't seem to get any ewtTracking or anything in the AppFabric dashboard.

Apologies if this is in the wrong forum 




Hi everybody,

I'm trying to get the How-to "Host a non-service workflow in IIS" working. (http://msdn.microsoft.com/en-us/library/ff729688.aspx)

I followed it step by step, but when it comes to the point where you browse to http://localhost/MyCreationEndpoint everything I get is:

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.


I also tried the URL http://localhost/MyCreationEndpoint/Workflow1.xamlx, which is used as EndpointAddress later on. On this address I get:

The resource cannot be found.

Server Error in '/MyCreationEndpoint' Application.
The resource cannot be found.Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /MyCreationEndpoint/Workflow1.xamlx

Version Information:  Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


Did anybody get this How-to working?
Any suggestions?


in this article, it was mentioned: 

A    Batch processing

a.     The scenario is that you want to batch process orders at off peak times or weekend. Typically this scenario is that a web application takes the order and puts it in the queue, and the orders are processed from at the end of the day when servers are typically otherwise idling.

 Can someone elaborate on the point? Do you have examples on how to do it?


Hi All,

Can anyone please tell me what configuration do i need to put in my WCF Service config file so that the clients can access the WCF Service (via Service Bus) without any credentials. However, the Service needs to mention the shared credentials so that it can have "listening" permissions on the service bus.

Many thanks,



I've read other posts where people have experienced this issue, but their problems seem to be related to using Application Pool Identity rather than Windows authentication. I'm using Windows authentication, and made it through the switch from local caching and load testing without experiencing this error. The site ran fine under full load for 28 hours, then began to crash repeatedly with this error, and I'm at a loss as to why.

I have installed only the caching portion of AppFabric on the caching servers, not any of the Dublin bits. Is there some dependancy on the Dublin portion in the caching where it tries to log to it on a failure?

The configuration is stored in a SQL Server 2005 DB, which I'm considering upgrading to see if it will help, but as stated previously, it ran fine for some time before falling over.  Is there anything in the caching that is specific to SQL Server 2008?

There are some rather large items being inserted into the cache, so I've had to expand the maxBufferSize beyond the default of 8MB to accommodate for this. Is there a recommended limit to this where it could potentially cause the cache cluster to become unstable?

The error message and config is below. Any ideas on what could be causing this or tips on finding the cause?


AppFabric Caching service crashed with exception {System.Runtime.CallbackException: Async Callback threw an exception. ---> System.IdentityModel.Tokens.SecurityTokenValidationException: The service does not allow you to log on anonymously.
   at System.ServiceModel.Security.SecurityUtils.ValidateAnonymityConstraint(WindowsIdentity identity, Boolean allowUnauthenticatedCallers)
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeAcceptor.CreateClientSecurity(NegotiateStream negotiateStream, Boolean extractGroupsForWindowsAccounts)
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeAcceptor.OnAcceptUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
   at System.ServiceModel.Channels.StreamSecurityUpgradeAcceptorBase.AcceptUpgrade(Stream stream)
   at Microsoft.ApplicationServer.Caching.VelocityStreamSecurityUpgradeAcceptor.AcceptUpgrade(Stream stream)
   at System.ServiceModel.Channels.InitialServerConnectionReader.UpgradeConnection(IConnection connection, StreamUpgradeAcceptor upgradeAcceptor, IDefaultCommunicationTimeouts defaultTimeouts)
   at System.ServiceModel.Channels.ServerSessionPreambleConnectionReader.ServerFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at Microsoft.ApplicationServer.Caching.WcfServerChannel.Listen(IAsyncResult result)
   at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
   --- End of inner exception stack trace ---
   at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
   at System.Runtime.InputQueue`1.AsyncQueueWaiter.Set(Boolean itemAvailable)
   at System.Runtime.InputQueue`1.CompleteWaiters(Boolean itemAvailable, IQueueWaiter[] waiters)
   at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)
   at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)
   at System.ServiceModel.Channels.InputQueueChannelAcceptor`1.EnqueueAndDispatch(TChannel channel, Action dequeuedCallback)
   at System.ServiceModel.Channels.ConnectionOrientedTransportManager`1.OnHandleServerSessionPreamble(ServerSessionPreambleConnectionReader serverSessionPreambleReader, ConnectionDemuxer connectionDemuxer)
   at System.ServiceModel.Channels.ConnectionDemuxer.OnSessionPreambleKnown(ServerSessionPreambleConnectionReader serverSessionPreambleReader)
   at System.ServiceModel.Channels.ServerSessionPreambleConnectionReader.ContinueReading()
   at System.ServiceModel.Channels.ServerSessionPreambleConnectionReader.StartReading(Action`1 viaDelegate, TimeSpan receiveTimeout)
   at System.ServiceModel.Channels.ConnectionDemuxer.OnDuplexConnection(IConnection connection, Action connectionDequeuedCallback, Int64 streamPosition, Int32 offset, Int32 size, TimeSpan timeout)
   at System.ServiceModel.Channels.ConnectionDemuxer.OnConnectionModeKnownCore(ConnectionModeReader modeReader, Boolean isCached)
   at System.ServiceModel.Channels.ConnectionModeReader.ReadCallback(Object state)
   at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead)
   at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)}. Check debug log for more information


        <section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <dataCache size="Small">
            <cache consistency="StrongConsistency" name="default">
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
            <cache consistency="StrongConsistency" name="en-CA">
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
            <cache consistency="StrongConsistency" name="en-US">
                    <eviction type="Lru" />
                    <expiration defaultTTL="10" isExpirable="true" />
            <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
                hostId="695648665" size="4095" leadHost="true" account="DOMAIN\US-CACHE-01$"
                cacheHostName="AppFabricCachingService" name="US-CACHE-01"
                cachePort="22233" />
            <host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
                hostId="1572658957" size="4095" leadHost="false" account="DOMAIN\US-CACHE-02$"
                cacheHostName="AppFabricCachingService" name="US-CACHE-02"
                cachePort="22233" />
            <partitionStoreConnectionSettings leadHostManagement="false" />
                    <allow users="everyone" />
            <transportProperties maxBufferSize="1000000000" />


Hi all,

I was wondering if any of the options accessible though the "Workflow host management" tab in AppFabric configuration is functional if the radio button named "custom or none" in the "Workflow Persistence" tab is activated.

If so, which of the options of the "Workflow host management" tab will not work properly in this particular scenario.



I have a windows service which creates multiples instances of a workflow service hosted using IIS/Appfabric. Now i want that all these workflow instances should work for my invokation and die out rather than persisting.However i want a specific hashtable to be persisted in cache for each instance which can be identified and retrieved from cache, when i am going to create workflow instance again.

Please let me know if this is possible in appfabric:-

1) To save and retrieve hashtables from appfabric cache by a specific id. e.g.Cache.getHashtable("DealerID")

2) Is this appfabric cache lifetime is only till the workflow instance is in existence or can it maintained beyond that.

Domain problem is:- I create one workflow instance for each dealer in my sales management application. Each workflow instance takes data about dealer details from a hashtable in appfabric cache,processes all the order for one dealer and die out. Next time when more orders come, i will again create instance of workflow, select hashtable from set of hastables( for all dealers) by Dealer id, get dealer details,process all orders for that dealer and die out.

Kindly respond urgent as it have to finalise solution based on this by tomorrow




I'm currently using VS 2010 Beta 2.  I am in the middle of architecting / designing a new product that will involve a significant amount of workflow on the server.  I have only been playing with WF 4 for a few days (largely watching videos with some tutorials) and never used WF in 3.0/3.5, but I think I have a fair high level understanding of how it works now.  In saying that I have a number of questions, largely driven by the Workflow, Services and AppFabric for the Web Developer tutorial on the AppFabric portal that I hope I might get some pointers from people in the community.  I'll apologise in advance for the length of this post :).

Most of the information I have found is geared towards how you do something, but I haven't really seen alot of guidance on what the recommended best practices are in terms of utilizing the technology stack.

Lets say my services will naturally involve 40% of workflow, and the remaining services 'could' have a simple sequence activity (perform audit, call business logic, return response, for example).  .Net 4.0 introduces WF Services which exposes a WF as a WCF service in which each workflow is a seperate xamlx file, which means that you have a seperate service for each logical 'operation' that only takes a single request / response as part of its workflow.  Where a standard WCF service will generally have a group of operations under a service.  WF Services solve a number of problems in regards to correlation, infrastructure, deployment, and monitoring when in conjunction with AppFabric which make them appealing to use.

I have a number of questions in regards to WF Services:
- Is the recommended practice is to use them across the board, for each and every operation in order to maintain a consistent API / structure?  Will this have a major performance impact if I am not persisting workflow for quick operations?
- If I wanted to keep my operations to a small set (or one) of logical services is my only option to have a behemoth service with some sort of Pick activity / trigger that fires a different workflow depending on the operation, or should I look at using the WCF routing service?
- If it is not recommended to make each logical operation a workflow, how do I best handle the situation where later down the line a logical operation becomes a WF Service and thus introduces a major breaking change to the service contracts despite its 'logical' signature not changing?

In a production environment what is considered the best strategy for keeping the size of the WF/AppFabric Monitoring / Persistence databases in check?  Through the use of PowerShell scripts, or can some sort of size limit be enforced?

In terms of the security context of a workflow, I saw in a video that you can use the existing WCF authorization / authentication infrastructure, but the operation context is unable to Workflow Services.  But sometimes in the application logic you want to know who the user is.  In the case where the service is configured to use Windows security will this still be available through the ServiceSecurityContext, or the current threads IPrincipal when executing inside a workflow?  Or will the contents of service contracts also need to contain the user?

I am a big fan of contract first design for my services and was disappointed to see that WF Services do not support this currently.  In saying that I created a dummy WF Service where I defined my request / response messages and assigned them to activities.  When generating the client proxy is seems to create two different versions of data contracts, the one I defined, and another one with a 1 appended on the end that contains my defined contract.  The generated client has an explicit IService interface implementation that uses the 1 appended version of the contracts, and a normal operation that uses the defined data contracts.  So two client operations for the same server operation.  Is this a sort of compromise?

In terms of logging and monitoring, AppFabric provides a rich experience, that lets activities also write out custom events.  I'm just confirming here, but I should still be writing out to a log (Ent Lib, or Log4Net for example) for my lower layers correct? 

This is the big question; versioning.  I understand that if I push out a new version of my workflow assemblies then the existing workflow instances will still be using the old version (similar to the behaviour of BizTalk orchestrations) which makes sense.  I also realize that I can control the server reasonable well by using sensible namespaces and using the WCF Routing service.  My issue is with the client, and general user experience.  Let's say that I have a very long workflow that involves alot of human interaction so it may take weeks to complete and on a client site I want to roll out an updated version of my software which involves both client (WPF, WinForms, Silverlight for example) and server updates.  OK I need to keep the old version of the server going, but whats the best way to handle the client experience?  Particularly if it is a Silverlight application and you want to minimize payloads by not having multiple service agents (with different contracts) being downloaded.  Users will probably baulk at being told to remember when they started a workflow and make sure that they load version X of the client for this workflow, and version Y for another.

Again apologies for the length of the post, alot of questions!



As per msdn blog, AppFabric ships with three out-of-the-box extensible workflow hosts:

Workflow Driven Application – A host for workflows which are used as an execution engine and which do not require WCF interaction to drive them. Workflow Service – A host for workflows which require WCF message interactions with the outside world. Scaled-Out-Service – A host which includes built-in tools for scaling out a workflow application across servers.

    I am hsting the workflows using the  WorkflowApplication Object.(not WorkflowServiceHost). i.e Workflow Driven Application.

    Can any body explains how to resume the workflow hosted through workflowapplication objet using the Appfabric? Please give some links with addresing the specific soultion to this problem.






I am new to using AppFabric to host WF4 services. I am trying to write a workflow admin application that will allow users to create xaml workflow definitions (loose xaml) using the hosted WF4 designer, and then somehow allow those workflow defitions to be automatically deployed and hosted in AppFabric with the click of a button.

I have the designer going, and I have read a couple of tutorials on how to host workflow services in AppFabric such as http://msdn.microsoft.com/en-us/library/ee677238.aspx, but my problem is how to deploy and host the loose xaml services via code.

Does anyone know if this sort of "autodeploy/host" thing can be done with AppFabric? If so, could you point me in the right direction on this?


Hi. When is workflow coming back to AppFabric? This is something I could really make use of now so would love to see its return in good time.




I get an error in AppFabric when trying to resume a worklow.

The worklow is communicating whith a WCF service which launchs deliberately an exception. The purpose is to resume the workflow after fixing the WCF service.

The WMS is working since I see its attemps to resume the worlkflow but I get this exception :

The message could not be dispatched because the service at the endpoint address 'net.pipe://MyMachine/MyWorkflow/MyWorkflow.xamlx/System.ServiceModel.Activities_IWorkflowInstanceManagement' is unavailable for the protocol of the address.

Then, the service stays in the suspended status.


How can I fix this issue ?





I created a simple long running workflow with flowchart and I’m using WorkflowServiceHost to host it on a console application, I’m using persistence too.

In order to manage instances I created a couple of endpoints:

WorkflowControlEndpoint controlEndpoint =



newEndpointAddress(newUri(baseAddress) + "/wce"));




CreationEndpoint creationEndpoint = newCreationEndpoint(


newEndpointAddress(newUri(new Uri(baseAddress) + "/wcreation")));




The creation endpoint is a class that inherits from WorkflowHostingEndpoint as in the workflow samples: (\\WF_WCF_Samples\WF\Basic\Execution\):


-          CreationEndpoint

-          ManagementEndpoint

-          ResumeBookmarkEndpoint


So, I execute the host, create a proxy reference to my endpoints and call. Everything work just fine. But now I want to host the same workflow in IIS/AppFabric. I’ve tried to accomplish that by following this guide: http://msdn.microsoft.com/en-us/library/ff729688.aspx but it’s not working, hope you can help me.



Thanks in advance,



Hi all,

I have a WF 4.0 hosted in AppFabric. I also have a BizTalk BAM Activity deployed and a BAM Interceptor configuration file deployed.

In order to track the WF activity and populate the BAM data, I have to add this configuration to the web.config of my Workflow :



   <add type="Microsoft.BizTalk.Bam.Interceptors.Workflow.BamTrackingService, Microsoft.BizTalk.Bam.Interceptors, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
   ConnectionString="Integrated Security=SSPI;Data Source=.;Initial Catalog=BAMPrimaryImport"


Now, when I start a new workflow instance, my application pool crash with this error:

Exception: System.AppDomainUnloadedException

Message: Tentative d'accès à un AppDomain non chargé. (Exception de HRESULT : 0x80131014)

StackTrace:  à System.StubHelpers.StubHelpers.InternalGetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis)
  à System.StubHelpers.StubHelpers.GetCOMHRExceptionObject(Int32 hr, IntPtr pCPCMD, Object pThis)
  à System.Web.Hosting.IApplicationPreloadUtil.GetApplicationPreloadInfo(String context, Boolean& enabled, String& startupObjType, String[]& parametersForStartupObj)
  à System.Web.Hosting.ProcessHost.GetApplicationPreloadInfoWithAssert(String context, Boolean& enabled, String& startupObjType, String[]& parametersForStartupObj)
  à System.Web.Hosting.ProcessHost.PreloadApplicationIfRequired(String appId, IApplicationHost appHostParameter, HostingEnvironmentParameters hostingParameters, LockableAppDomainContext ac)
  à System.Web.Hosting.ProcessHost.<>c__DisplayClasse.<PreloadApplicationIfNotShuttingdown>b__c(Object o)'. Le processus de travail sera marqué comme étant défectueux et sera arrêté. Le champ de données contient le code d'erreur.

How can I make this working ?



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure