views:

772

answers:

2

I am trying to deploy a Click Once application (build and publish) using CruiseControl.NET. I cannot find out where I can use the CCNetLabel to set my AssemblyVersion and/or PublishVersion. I would accept other solutions that would allow a unique version number per CruiseControl.NET deployment (Live and Development deployments).

A: 

You need to write a script for setting your AssemblyVersion. I would recommend using NAnt or MSBuild for that purpose, but PowerShell or a simple bat file will also do.

In your CCNET configuration you use Assembly Version Labeller. CCNetLabel is available then inside the script via ${CCNetLabel} (NAnt) resp. environment variable %CCNetLabel% (batch - try different casings, since I know they have an issue with that).

The script's task is to either edit the project's AssemblyInfo.cs file or create a CommonAssemblyInfo.cs file and reference it from the project for the build.

SO search for

[cruisecontrol.net] assemblyinfo

yields more valuable advice.

The Chairman
A: 

You need to set it before the compile in your AssemblyInfo.cs as the other answerer points out. The Assembly Version Labeller is great, but it doesn't work with svn. If you use svn, you might want to have a look at the svn revision labeller.

Once you get the label generating properly, you can use that in your CC or Nant script when creating/editing the AssemblyInfo.cs file. If you're using Nant, then the asminfo task will be of great help for you. An SO search would be good, but you might also want to have a look at this article, which should be very helpful.

KFB