MS Build - Publish to FileSystem

less than 1 minute read

I'm working for a simple project and wanted to deploy it to the webserver in my church. I installed TeamCity and set it up to pull the source code from github and build it.

The challenge was, unexpectedly, publish. Initially, I used MS Web Deploy. For some reason I couldn't figure out, it didn't work. Also, I had to install an extra service. So I went for a simple msbuild file system deploy.

[sourcecode language="powershell"]

msbuild .\WebDrive.csproj /t:Package
/p:_PackageTempDir="\\webserver\output" /p:Configuration="Release"


On TeamCity, I added an additional build step and configure it like these

  • Runner type: MSBuild
  • Build file path: WebDrive/WebDriveWeb.csproj
  • Targets: Clean;Build;Publish
  • Command line parameters: /t:Package /p:_PackageTempDir="\\web\output" /p:Configuration="Release"

Much simpler that web deployment.