Last post Feb 19, 2009 04:12 PM by aconyers
Feb 19, 2009 12:07 PM|aconyers|LINK
I have a WCF service published in my web application that is impimented by a WF workflow. When I use web.config replacement on this config section the connectionString, LoadIntervalSeconds and UnloadOnIdle attributes are stripped from the add element:
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionString="My Connection String" LoadIntervalSeconds="2700" UnLoadOnIdle="true" />
"Web Deployment Project"
Feb 19, 2009 04:12 PM|aconyers|LINK
I did a little more digging and here is the problem: The services element in the XML snippet maps to the WorkflowRuntimeServiceElement
class. It looks like since there is no connectionString, unloadOnIdle, or loadIntervalSeconds properties in that class, the WDP strips the attributes out. Is there any way to prevent that from happening?
If anyone else runs into this exact problem I found a work-around. I created three seperate service behaviors "DebugBehavior", "TestBehavior", and "ProductionBehavior" and instead of replacing the behaviors section, I replace the services section and choose
the correct service behavior there. For example :
<service name="AssetTracking.Workflows.Transfer" behaviorConfiguration="Transfer.TestBehavior">
<endpoint address="" binding="wsHttpContextBinding" bindingConfiguration="transferBinding" contract="AssetTracking.Services.IAssetTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />