SEARCH:   GO
{latest Blog entries}
Aug 18

Written by: Javier Callico
8/18/2009 12:00 AM 

Assumptions:

  1. Basic knowledge of CruiseControl.net
  2. MSBuild will be used to build the application and must be installed.
  3. The .net solution containing the web application to publish is located on D:\Projects\SampleSite\Source.
  4. The name of the solution file containing the web application project is SampleSite.sln.
  5. The name of the web application project file is SampleSite.csproj.

Since the buildpublisher task copies all files on the source directory, including the .cs files, a custom MSBuild script is needed to take advantage of the _CopyWebApplication option which will only copy the runtime files. An additional step is required to copy any other required assembly on the bin directory since only the application's main assembly is originally copied when using the _CopyWebApplication option.

This is the entry for this project on the ccnet.config file:

ccnet.config

This is the content of the MSBuild.xml file referenced on the msbuild task, it should be created on the working directory, in our case "D:\Projects\SampleSite\Builds\Latest Build".

msbuild.xml

... now simply force a build for your project and your website should be published to the final location specified on the buildpublisher task, in our case "C:\InetPub\wwwroot\SampleSite".

Both, the ccnet.config and msbuild.xml files can be downloaded from here.

Tags:

2 comment(s) so far...

Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.

Why do you need CruiseControl? What's wrong with "Publish Website"?

By Remus on   9/6/2009 9:48 PM

Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.

@Remus:
There is nothing wrong with the "publish website" option in VS if your only requirement is manually publishing your site but if you want to automatically build your code, run tests and other code analysis tools and also publish your site, that is continous integration, and you happen to be using Cruise Control then you may find this post helpful.

You may find this article interesting:
martinfowler.com/articles/continuousIntegration.html

By Javier Callico on   9/6/2009 9:58 PM

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel