Aug
18
Written by:
Javier Callico
8/18/2009 12:00 AM
Assumptions:
- Basic knowledge of CruiseControl.net
- MSBuild will be used to build the application and must be installed.
- The .net solution containing the web application to publish is located on D:\Projects\SampleSite\Source.
- The name of the solution file containing the web application project is SampleSite.sln.
- 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:

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".

... 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.
8 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
|
Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.
Excellent article, it solves all of my problems... thanks for sharing the good article
By Yashwant on
11/8/2010 9:57 PM
|
Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.
@Yashwant: I'm glad you found the article helpful.
By Javier Callico on
11/8/2010 9:59 PM
|
Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.
Hi. In the ccnet.config file there's a comment which says "note the reference to the MSBuild.xml file", but there is no reference. Or am I missing something?
By Phil Hale on
2/16/2011 2:28 PM
|
Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.
@Phil: The reference you are looking for is projectFile inside the msbuild task. Also note that since the reference to the MSBuild.xml file is relative this file has to be located under the workingDirectory.
By Javier Callico on
2/16/2011 2:37 PM
|
Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.
Sorry! I've realised the problem, I'm an idiot! For some reason I didn't spot the reference to the MSBuild.xml file when I scanned the page. Then I tried to do a text search and didn't find anything. But of course you can't find text in an image.
By Phil Hale on
2/17/2011 9:51 AM
|
Re: How to only publish the runtime files of an asp.net application using CruiseControl.net.
@Phil: The fact that you were not able to find the reference easily only proves that images are not an efective way to display code. I realized this long time ago and switched to SyntaxHighlighter for code displaying and formating.
By Javier Callico on
2/17/2011 9:58 AM
|