How to use Subversion , nant & cruise - go build server to achieve continuous integration of .net projects
Use subversion as source code repository. All working code goes inside /trunk folder. Set Cruise- Go server to continuously poll subversion server for modification and if it senses change, then cruise agent pull all the code. You can do this through setting pipeline in cruise configuration file.
NANT build script themselves are part of source code so they gets pulled in whenever cruise agent download source code. It means build script themselves are version controlled ;)
Build scripts then run tasks as specified in cruise configuration files (pipeline configuration), usually compile project , run unit tests , copy correct configuration files based on environment name parameter (dev , qa , live) and then copy them to target folder.
QA server disk must be accessible to cruise agents - thus it can push latest changes & configuration files as soon as source code is changed on svn. These folders on QA server are also mapped to IIS web sites.
This way QA websites are continuously updated with code changes, asset files, configuration files.
Heres diagram :

Facebook timeline -This is how your facebook timeline is going to look like
How to use C# inside nant build scripts
I use c# to take input from user (via command line) to take certain actions in build script. Here’s code that ask name of web app and will copy necessery files to target directories.
<target name=”AskAndDeploy”>
<script language=”C#” prefix=”DNSNamePrefix” >
<code><![CDATA[
[Function(“ask”)]
public string AskDNSNamePrefix(string prompt) {
Project.Log(Level.Info, prompt);
try
{
return Console.ReadLine();
}
finally
{
}
}
]]></code>
</script>
<echo message=”If Your website is called foo.dev.co.uk then enter foo as DNS Prefix. Config files will be updated to point AT http://foo.dev.co.uk ” />
<property name=”DNSNamePrefix” value=”${DNSNamePrefix::ask(‘What is the web DNS name prefix ?’)}” />
<property name=”Build.Env.Name” value=”qa” />
<property name=”Solution.Dir.Path” value=”C:\Projects\phoenix” />
<copy todir=”\appqawin\projects\${DNSNamePrefix}WS.qa">
<fileset basedir=”${Solution.Dir.Path}\src\JB.WebService">
<include name=”**\*”/>
<exclude name=”**/bin/JB.Common.config” />
</fileset>
</copy>
</target>