Something like
msbuild /t:publish [use PublishProfileName] someproject.csproj
Something like
msbuild /t:publish [use PublishProfileName] someproject.csproj
msbuild MyProject.csproj /t:PipelinePreDeployCopyAllFilesToOneFolder /p:Configuration=Release;_PackageTempDir=C:\temp\somelocation;AutoParameterizationWebConfigConnectionStrings=false
See MSBuild 2010 - how to publish web app to a specific location (nant)?
This is an alternative solution for achieving Pavel's solution but using MsBuild target in a MsBuild file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<OutputDirectory>$(DeploymentProject)\bin\$(Configuration)</OutputDirectory>
<OutputPath>C:\Inetpub\wwwroot</OutputPath>
</PropertyGroup>
<Target Name="build">
<MSBuild
Projects="Your Solution File.sln"
Properties="Configuration=$(Configuration);DeployOnBuild=true;DeployTarget=Package;_PackageTempDir=$(OutputPath);AutoParameterizationWebConfigConnectionStrings=false"
>
</MSBuild>
</Target>
</Project>