According to this post , here is another way to publish your web application. I used this method to publish the .asmx web service. The trick is _CopyWebApplication msbuild target, which makes redistributable files for your web application.
# ...setup properties task PublishWebService -depends Compile { $output_dir = "$build_dir\$configuration\Web" $output_bin_dir = "$output_dir\bin\" msbuild $webservice_project_file /t:ResolveReferences /t:_CopyWebApplication /p:Configuration=$configuration /p:WebProjectOutputDir="..\$output_dir" /p:OutDir="..\$output_bin_dir" if (-not (Test-Path $web_service_inetpub_dir)) { mkdir $web_service_inetpub_dir } copy $output_dir\* -destination $web_service_inetpub_dir -recurse -force "Publish OK!" }
See also this post for some information on setting up and tearing down IIS sites and application pools from your psake script.
UPDATE: I found the following commands to work a little better. The one I posted above does not properly apply web.config conversions.
# ... msbuild /t:Rebuild /p:OutDir=..\$output_dir\ /p:Configuration=$build_configuration /p:UseWPP_CopyWebApplication=True /p:PipelineDependsOnBuild=False /p:TrackFileAccess=false "$web_app_project_file"
ngm
source share