从文本文件读取文件目录,并使用MSBuild将其复制到远程服务器
我有一个文本文件从文本文件读取文件目录,并使用MSBuild将其复制到远程服务器,msbuild,copy,unzip,7zip,msbuild-task,Msbuild,Copy,Unzip,7zip,Msbuild Task,我有一个文本文件FileList.txt,它有以下内容 D:\Temp\File1.zip D:\Temp\File2.zip 我希望将这些文件移到另一台服务器上,并在构建执行期间解压缩 需要完成的基本操作有 1. Read the text file 2. Copy the files one by one to another server 3. Unzip the files copied 我正在使用以下代码 <ReadLinesFromFile File
FileList.txt
,它有以下内容
D:\Temp\File1.zip
D:\Temp\File2.zip
我希望将这些文件移到另一台服务器上,并在构建执行期间解压缩
需要完成的基本操作有
1. Read the text file
2. Copy the files one by one to another server
3. Unzip the files copied
我正在使用以下代码
<ReadLinesFromFile File='$(UpgradeSequenceFilePath)' > <Output TaskParameter="Lines" ItemName="DirectoryList" /> </ReadLinesFromFile>
<Copy SourceFiles="@(DirectoryList)" DestinationFolder="$(DatabaseInstallerRemotePath)" />
这是为我复制文件。现在如何解压文件?您尝试过什么,即您有实际的代码问题吗?通过搜索“如何使用msbuild执行x”可以很容易地找到这些要点中的任何一点:这只是ReadLinesFromFile/Copy/msbuild.Community.Tasks.UnzipDestinationFolder必须是一个目录的问题。我假设DestinationFolder=“$(DatabaseInstallerRemotePath)”是您想要的?是的,我做了那个更改,它对我有效。解压过程中有什么进展吗?如前所述,下载MSBuild社区任务,导入它并使用解压