Skip to content

Instantly share code, notes, and snippets.

@i-e-b
Created June 6, 2012 11:43
Show Gist options
  • Save i-e-b/2881427 to your computer and use it in GitHub Desktop.
Save i-e-b/2881427 to your computer and use it in GitHub Desktop.
MSBuild commands for "Publish Website" behaviour
$build = "$env:windir\Microsoft.NET\Framework\v3.5\MSBuild.exe"
$SolutionPath = "C:\Projects\AdminWebSite"
$SolutionFile = "AdminWebSite.sln"
$WebProjectFile = "Admin.Web\Admin.Web.csproj"
$OutputPath = "C:\PublishedSites\Hosts\adminweb"
& $build "$SolutionPath\$SolutionFile" /t:rebuild
& $build "$SolutionPath\$WebProjectFile" "/t:ResolveReferences;_CopyWebApplication;publish" /p:OutDir="$OutputPath\bin\" /p:WebProjectOutputDir="$OutputPath"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment