问题
Using Team Foundation Server continuous deployment with Web Depoly, is it possible to stop certain folders being deployed? And if it is, how?
UPDATE You can't specify a skip rule via the command line (as in, an MSBuild Argument) because they are declared as items, not properties.
A skip command can be specified in a publish profile. However it seems publish profiles are only for the inbuilt publishing in visual studio, not Web Deploy 3.
Is there a way for Web Deploy to accept a publish profile, and if there is, should this be checked into TFS?
回答1:
It sounds like you are confusing the MSDeploy command line with executing MSBuild via the command line.
If you are executing msdeploy.exe or the generated deploy.cmd file, MSBuild doesn't even come into it and you are free to use the MSDeploy Skip Command (you can append additional command line arguments to the cmd call and they will be passed to msdeploy.exe).
If you are using MSBuild + "DeployOnBuild" or MSBuild + publish profiles you will need to declare your skip requirements as MsDeploySkipRules
items. If you're building your package separately before this point and want to deploy it, you're going to run into some roadblocks.
回答2:
I also had the same issue, however found that there is switch you can use that does not require a profile. Having said that, a profile has other benefits. Here is the argument I used that works
/p:SkipExtraFilesOnServer=true
来源:https://stackoverflow.com/questions/14090567/not-include-certain-folders-in-a-continuous-deployment-with-tfs-skip-command