Here is how I do it in my web site project. Note that this will copy to a folder; if you want to publich through FTB, WebDav or SSH, you need to use the `Exec` task instead of the `Copy` task and specify a command-line tool that can deploy the files over the desired protocol.
Also, you can't edit the `AfterBuild` task from the project settings in the VS IDE. You need to open it in Notepad or your favorite text/XML editor. (You could even use VS, if you close the solution and enforce it to open the file with the XML editor :-))
There's also a build target that invokes the `AspNetCompiler`, which I have currently turned off, but you could easily turn on through the `MvcBuildViews` property value.
<PropertyGroup>
<MvcBuildViews>false</MvcBuildViews>
<DropPath>..\..\drop\</DropPath>
</PropertyGroup>
<Target Name="AfterBuildCompiler" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
<Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler">
<ConvertToAbsolutePath Paths="$(DropPath)">
<Output TaskParameter="AbsolutePaths" ItemName="FullDropPath" />
</ConvertToAbsolutePath>
<Message Importance="High" Text="Binplacing -&gt; @(FullDropPath)" />
<ItemGroup>
<Binaries Include="$(OutputPath)**\*.*" />
</ItemGroup>
<Copy SkipUnchangedFiles="True" SourceFiles="@(Compile)" DestinationFiles="@(Compile->'$(DropPath)%(Identity)')" />
<Copy SkipUnchangedFiles="True" SourceFiles="@(Content)" DestinationFiles="@(Content->'$(DropPath)%(Identity)')" />
<Copy SkipUnchangedFiles="True" SourceFiles="@(EntityDeploy)" DestinationFiles="@(EntityDeploy->'$(DropPath)%(Identity)')" />
<Copy SkipUnchangedFiles="True" SourceFiles="@(Binaries)" DestinationFiles="@(Binaries->'$(DropPath)%(Identity)')" />
</Target>