Publish an ASP.net Web Application with Team City

I've figured out how to publish an ASP.net Web Application with Team City using the sln2008 runner and thought that I'd share.

In step 6 of the Build Configuration add a System Property name OutDir (I'm not sure if case matters or not) and give a value of something arbitrary like "publish/" (do not include the quotes). I found that it is picky it didn't like the "\" but maybe you could try escaping it and that would work.

Then inside the the csproj file for the web application, open it in Notepad and find the AfterBuild element, ususally it is commented out towards the bottom of the file.

  <Target Name="AfterBuild">
    <Exec Command="xcopy &quot;$(WebProjectOutputDir)&quot; &quot;\\server\www.website.com&quot;"/>

I was using beyond compare with a script but changed this sample to use xcopy for shortness.


Please sign in to leave a comment.