I'm deploying my website to IIS, using msbuild (as mentioned by Scott Hanselman here) like this:
msbuild MySolution.sln /p:DeployOnBuild=true;PublishProfile=Production;Password=poo
Which is mostly working fine to publish to my production server, or staging server, via TeamCity.
However, if some files have been removed from the project they are not deleted from the server. So some things that should be generating 404 errors are just picking up the old, out of date, files.
Is it possible to make deploying in this way also delete files that are no longer part of the web project?