.Net Framework 2.0 emerged with the very powerful and sophisticated compilation architecture here is a very brief description how we can compile a website in .Net 2.0 using MSBuild (Build tool shipped with .Net Framework 2.0)



Prerquisites:
     > Understading of Build tool, Build Tasks and Properties
     > Compilation Modes in .Net Framework 2.0

Those who are not aware of Build Tool, can follow the below given steps to compile Asp.Net 2.0 Website

1. Create a file with extention .msbuild with the following xml, replace the WebsiteName, PrecompiledAssembliesPath and BuildDirectory with your values.  

<Project DefaultTargets="Main" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
 <WebsiteName>MyWebSite</WebsiteName> 
 <PrecompiledAssembliesPath>E:\temp\Project\Build\</PrecompiledAssembliesPath>
  <BuildDirectory>E:\temp\Project\</BuildDirectory>
  </PropertyGroup>
  <Target Name="Main">
 <AspNetCompiler 
         VirtualPath="/$(WebsiteName)"
     PhysicalPath="$(BuildDirectory)"
     TargetPath="$(PrecompiledAssembliesPath)"
     Force="true"
     Debug="true"
     Updateable="true"
 />
  </Target>
</Project>

References: http://msdn2.microsoft.com/en-us/library/7z253716.aspx

2. Run Following command from command line from .Net 2.0 Command prompt (MSBuild.exe is available in..     
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727)
    MSBuild.exe C:\Progra~1\MSBuild\temp.msbuild

Actually the compilation is being done through aspnet_compiler.exe, which is called by AspNetCompiler task in MSBuild script. the task attributes like PhysicalPath, Debug, Updateable are mapped with aspnet_compiler.exe command line arguments inturn.

I hope this article covers enough things around MSBuild and .Net 2.0 compilation. feel free to ask for any clarification.