How do I get an msbuild task to do config transforms on a collection of files?

前端 未结 1 494
礼貌的吻别
礼貌的吻别 2020-12-30 12:00

I am trying to transform all of the web.config files in a project I have, here\'s a my tree structure:

  • Transform.bat
  • Transforms
    • ConfigTransfo
1条回答
  •  北荒
    北荒 (楼主)
    2020-12-30 12:48

    I think you were pretty close. I have pasted a sample below which shows how to do this.

    In my sample I discover the transform sitting next to the web.config file itself. For your scenario you can just use an MSBuild property pointing to a specific file.

    
    
    
      
    
      
        Release
        C:\temp\transformed-files\
      
    
      
      
    
        
        
          
        
    
        
        
    
        
            
      
    
    
    

    FYI you can download a full sample at https://github.com/sayedihashimi/sayed-samples/tree/master/TransformMultipleWebConfigs.

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