I have an msbuild step in TFS which builds my csproj using octopack.
Now, I committed a change to git with the following in AssemblyInfo.cs :
I then proceeded to build this in tfs which gave me this release number:
Now I queued a build up again straight after to check it worked twice and octopack gives the following message (and then errors as a package exists in octopus with the same name):
Successfully created package ‘\TFSBUILDS\Fast\obj\octopacked\PRODUCT.220.127.116.11.nupkg’.
I’m just wondering why the version number from AssemblyInfo.cs was only taken the first time, and the second it failed?
Well I found that the version of the dll (product.dll) in the bin folder is 18.104.22.168 but i don’t know where it is getting this from.
Thanks for reaching out. The version on the DLL will be set by
AssemblyFileVersion inside of AssemblyInfo.cs. RE the package version going back to 22.214.171.124, have you checked that your change to
AssemblyVersion wasn’t rolled back in source control after the first time it worked?
One thing to note that I have hit a few times… MSBuild is a part of this process. If it doesn’t rebuild anything, it will not increment the version. For instance run a build. Then change only a web.config. Run another build and the nuget package name will not increment.
The solution i have found is to make sure the msbuild Clean parameter is always specified (/t:Clean,Build).