Attributes stripped from web.config during replacement

Last post 02-19-2009 4:12 PM by aconyers. 1 replies.

Sort Posts:

  • Attributes stripped from web.config during replacement

    02-19-2009, 12:07 PM
    • Member
      point Member
    • aconyers
    • Member since 02-19-2009, 11:56 AM
    • Posts 2

    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:

    1    <behaviors>
    2        <serviceBehaviors>
    3        <behavior name="Transfer.ServiceBehavior">
    4            <serviceMetadata httpGetEnabled="true" />
    5            <serviceDebug includeExceptionDetailInFaults="true" />
    6            <workflowRuntime validateOnCreate="true">
    7            <services>
    8                <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" />
    9            </services>
    10           </workflowRuntime>
    11       </behavior>
    12       </serviceBehaviors>
    13   </behaviors>
    14   
    

    Any suggestions?

     

    Thanks

        -AC

  • Re: Attributes stripped from web.config during replacement

    02-19-2009, 4:12 PM
    Answer
    • Member
      point Member
    • aconyers
    • Member since 02-19-2009, 11:56 AM
    • Posts 2

    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 :

       <services>
    <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" />
    </service>
    </services>
     
       -AC 
      
Page 1 of 1 (2 items)