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?
In the publish profile, on the Settings tab expand File Publish Options and select Remove Additional Files. Or for Web Deploy profiles you can pass in the value on the command line as /p:SkipExtraFilesOnServer=False
For FTP profiles, the property is /p:DeleteExistingFiles=True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With