this is a small revision to a previous post NAnt build with TFS changeset as revision number
apparently there is a limitation on the size of the number used in each segment of a .net assembly version so this is a slight update to the c# code that gets the latest changeset from TFS - changes start at "if(latestChangsetId > 65534)"
see also AssemblyVersion - BuildNo Limitation
All of the code samples have now been consolidated and moved to my blog at http://house9.blogspot.com/. Many google searches still point here so I am leaving this blog operational.
Showing posts with label tfs. Show all posts
Showing posts with label tfs. Show all posts
Thursday, April 9, 2009
Sunday, April 20, 2008
NAnt build with TFS changeset as revision number
This code sample is a nant script that
basically I just put together a few bits that I found on other blogs (should have saved the urls - doh!), most were related to using svn for source control and then I added in the code block for the c# stuff to query TFS.
A quick note about the linked CommonAssembly.cs file, visual studio has an option when you are adding an existing file to a project to select 'linked', click the arrow on the 'Add' button when you select your existing file
what this script does not do - get latest from TFS, I usually do that part manually or from ccnet
the c# bit that goes in the nant script block above
nant is awesome!
- deletes the CommonAssembly.cs file (linked to all projects)
- uses the nant asminfo task to recreate the CommonAssembly.cs file, but after we query TFS for the changeset (revision) number which is used in the version number
- build the solution in release mode using the ide.exe (there are other - better ways, but this one works)
- xcopy files to C:\temp\{app} and clean up all the source files
basically I just put together a few bits that I found on other blogs (should have saved the urls - doh!), most were related to using svn for source control and then I added in the code block for the c# stuff to query TFS.
A quick note about the linked CommonAssembly.cs file, visual studio has an option when you are adding an existing file to a project to select 'linked', click the arrow on the 'Add' button when you select your existing file
what this script does not do - get latest from TFS, I usually do that part manually or from ccnet
the c# bit that goes in the nant script block above
nant is awesome!
Subscribe to:
Posts (Atom)
Custom Search