MSbuild Copy whole folder

前端 未结 7 753
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-03 17:43

trying to copy a whole folder, but when i do this:


7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-03 18:31

    The best solution for me was to use the magic XCOPY as I had to copy all files and sub directories

    
      
        $(ProjectDir)\lib
        $(ProjectDir)\..\..\Something\lib
        $(SolutionDir)\Something\lib
      
      
      
      
      
    
    

    This build event is fired once build succeed, it cleans the FilesDestination folder then it copies all files with directory structure from FilesSource to FilesDestination and then it delete the FilesSource folder to keep everything "bien propre" :)

    NOTE

    For FilesDestination, make sure you use the Condition attribute or remove it to have the copy process to its end

提交回复
热议问题