如何使用 msdeploy.exe 在 Web Deploy V3 cmd 行中排除文件夹

How to exclude folder in Web Deploy V3 cmd line using msdeploy.exe

我正在使用 Nant 使用 TeamCity 构建 CI。在部署到服务器时,我坚持使用最后一段代码排除 App_Data 文件夹。这是我的代码:

C:\Program Files\IIS\Microsoft Web Deploy V3>msdeploy.exe 
-verb:sync 
-source:contentPath="C:\a\testteamcity\Demo\WebApp\obj\Release\Package\PackageTmp"  
-dest:contentPath='prod.test/deploy'
-skip:Directory="App_Data" -skip:objectName=dirPath,absolutePath="\App_Data"
,ComputerName="https://XXX:8172/msdeploy.axd?prod.
test",UserName='XXX\abc',Password=****',AuthType='Basic' 
-allowuntrusted -usechecksum 



Error: Unrecognized skip directive 'Directory'. Must be one of the following: "objectName," "keyAttribute," "absolutePath," "xPath," "attributes.<name>."
Error count: 1.

我在这段代码中做错了什么任何帮助都会很有帮助。

配置(为便于阅读而添加的换行符):

-verb:sync 
-source:contentPath="D:\Releases.107.1323" 
-dest:contentPath='%system.website%',
      ComputerName="%system.computername%%system.226.website%",
      UserName='%system.un%',
      Password='%system.pw%',
      AuthType="Basic" 
-skip:Directory="%tfs.skip.directory%" 
-EnableRule:DoNotDeleteRule 
-allowuntrusted 
-usechecksum

其中 tfs.skip.directory -->\App_Data Configuration parameter