Trying to exclude certain extensions doing a recursive copy (MSBuild)

后端 未结 1 1795
太阳男子
太阳男子 2021-01-04 01:40

I\'m trying to use MSBuild to read in a list of files from a text file, and then perform a recursive copy, copying the contents of those directories files to some staging ar

1条回答
  •  醉话见心
    2021-01-04 02:00

    You have to specify the Exclude in absolute path and change the exclude wildcard to include subdirectory

    If you use an absolute path for Include, you must use an absolute path for Exclude. If you use a relative path for Include, you must use a relative path for both.

    
      c:\temp
      **\*.tmp
      staging
    
    
      
    
    
    
      
        
      
    
      
        
      
    
      
    
    

    Multiple excludes and absolute path

    If you want to exclude multiple items, there is no clean way when you are using absolute path, but you could do with Remove.

    First way : Using Remove and item

    
      c:\temp
    
    
    
      
      
      
      
    
    
    
      
        
      
    
      
        
      
    
      
      
        
      
    
      
    
    

    Second way : Using Remove and condition

    
      
        
      
    
      
        
      
    
      
      
        
        
      
    
      
    
    

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