Colin Hay
Colin Hay

Reputation: 45

Replacing tags in web.config using a web.release.config transform file

I have a web.config file which I am trying to transform to use predefined tags

snippit:

<responseFetcherJobSection>
<responseFetcherJobs>
    <responseFetcherJob recurringJobId="ObanResponseFetcher" cronExpression="0 23 15 * *" sourceFolder="\\172.16.65.34\Oban Key Service - Messages\Inbound\300002" batchSize="20" backupFolder="\\172.16.65.34\Oban Key Service - Messages\Backup\Inbound\300002" jobType="ObanResponseFetchJob" fileExt="*.bin," infoLogger="LoggerInfo" />
    <responseFetcherJob recurringJobId="ObanErrorFetcher" cronExpression="0 23 15 * *" sourceFolder="\\172.16.65.34\Oban Key Service - Messages\Error" batchSize="20" backupFolder="\\172.16.65.34\Oban Key Service - Messages\Backup\Error" jobType="ObanErrorFetchJob" fileExt="*.bin," infoLogger="LoggerInfo" />
</responseFetcherJobs>

web.release.config is

<?xml version="1.0" encoding="utf-8"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <elmah>
        <errorLog type="Elmah.XmlFileErrorLog, Elmah" 
                  logPath="D:\OneOffice Logs\#{Elmah.LogPath}\oneoffice.webapi\Elmah" 
                  xdt:Transform="SetAttributes" 
                  xdt:Locator="Match(type)" />
    </elmah>

  <responseFetcherJobs>
    <responseFetcherJob
          recurringJobId="ObanResponseFetcher"
          sourceFolder="#{Oban.FetchInbound}"
          backupFolder="#{Oban.FetchInboundBackup}"
                  xdt:Transform="SetAttributes"
                  xdt:Locator="Match(recurringJobId)" />
    <responseFetcherJob
          recurringJobId="ObanErrorFetcher"
          sourceFolder="#{Oban.FetchError}"
          backupFolder="#{Oban.FetchErrorBackup}"
                  xdt:Transform="SetAttributes"
                  xdt:Locator="Match(recurringJobId)" />
</responseFetcherJobs>


    <system.web>
        <compilation xdt:Transform="RemoveAttributes(debug)" />

    </system.web>
</configuration>  

The transformation file is valid according to VS but it does not replace the Oban folder names with the # tags - it does the operation on the Elmah tag and removes the debug clauses OK though

Upvotes: 0

Views: 12

Answers (0)

Related Questions