[p4] Adding Changelist # of project to .Net Assembly?

Slava Imeshev imeshev at yahoo.com
Thu Oct 19 22:53:47 PDT 2006


---- Original Message ----- 
> Now, I'm thinking about trying to do the same thing with a Visual Studio
> 2005/C# project -- and I believe that the "correct" way to do this would
> be to generate the AssemblyVersion attribute from the Perforce
> changelist #, such that it'd be 
> 
> [assembly: AssemblyVersion("1.0.0.98776")]
> 
> Where 98776 is the Changelist #.  Normally this attribute is hardcoded
> in the AssemblyInfo.cs file.
> 
> Does anyone have any ideas about how to generate this in the Pre-Build
> steps for C#/.Net applications?  

As Michael Nau noticed, using change list numbers as a part of the 
assembly version could be challenging. A build number could be a better 
candidate for this.

As for the getting the build number into the assembly version it's just a matter
of defining the assembly version having a token an replacing it with actual
build values at build time.

You might be interested in checking our Parabuild. It provides you both
the build number and P4 change list number that the build is running at.

Hope this helps.

Regards,

Slava Imeshev


More information about the perforce-user mailing list