I wrote a simple application that takes a project path, finds the assembly and file versions and updates them. It works as expected, but when I set it up as a pre-build event command-line like this:
$(SolutionDir)AdvanceBuildnumber\bin\Debug\AdvanceBuildnumber.exe $(ProjectDir)
and then do a build, the compiled application has the prior version even though inspection of the AssemblyInfo.cs file shows it was correctly updated. Here's an excerpt from the output of a build. Examining the produced executable, I find that it is version 1.0.5.09084 even though inspection of AssemblyInfo.cs reveals 1.0.6.09084
------ Build started: Project: AtomLogger, Configuration: Debug Any CPU ------
D:\AtomProtocol\AdvanceBuildnumber\bin\Debug\AdvanceBuildnumber.exe D:\AtomProtocol\AtomLogger\
AssemblyInfo.cs SET BUILD NUMBER FOR AssemblyInfo.cs TO 1.0.6.09084
C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE;DEBUG;APP /reference:D:\AtomProtocol\AtomLib\bin\Debug\AtomLib.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.configuration.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Configuration.Install.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.Linq.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Management.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.ServiceProcess.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\AtomLogger.exe /resource:obj\Debug\AtomLogger.ProjectInstaller.resources /target:winexe ProjectInstaller.cs ProjectInstaller.Designer.cs Properties\Settings.Designer.cs Logger.cs Logger.Designer.cs Program.cs Properties\AssemblyInfo.cs Settings.cs
Compile complete -- 0 errors, 0 warnings
AtomLogger -> D:\AtomProtocol\AtomLogger\bin\Debug\AtomLogger.exe
I'm absolutely flummoxed as to what's going on here. Can anyone shed some light?
For the record, it's major.minor.build.revision
where build is a number incremented each build and revision is the year and the day of the year (09 then 084)