Web Config Transformation to add a child element

后端 未结 2 477
太阳男子
太阳男子 2020-12-30 18:22

I\'ve got the following configuration in web.config:

  
    
    
      

        
相关标签:
2条回答
  • 2020-12-30 18:48

    You can use the Insert transformation:

     <resizer>
        <plugins>
          <add name="AzureReader" connectionString="DataConnectionString" 
               xdt:Transform="Insert" />
        </plugins>
      </resizer>
    

    Web.config Transformation Syntax for Web Application Project Deployment

    0 讨论(0)
  • 2020-12-30 19:00

    If you want to do it using XSLT then here is some guidance as I don't have time right now to knock this out.

    1. Look up the identity transform. That will give you a simple XSLT that duplicates exactly what reads.
    2. Add a template above the generic templates with the following match match="add[@name='MvcRoutingShim']"
    3. Inside the template output the element you are processing using xsl:copy and then output the AzureReader add element

    That should get you going.

    Make sure you have an XML editor that allow you to do transforms so you can experiment locally until you get it right.

    0 讨论(0)
提交回复
热议问题