1

Resolved

Update/Create all three "types" of assembly version during compile when it is not there (AssemblyInfo.cs) initially

description

Assembly version was not updated during compile. Related discussion: http://npanday.codeplex.com/Thread/View.aspx?ThreadId=215098
Apart from the issue mentioned in the discussion in the patch functionality for injecting build number (through BUILD_NUMBER environment variable) has been implemented. Although this is not related to the main issue but in this way AssemblyVersion, AssemblyFileVersion and AssemblyInformationlVersion updating during compile will be complete. If BUILD_NUMBER is not set there won't be any error.
 
I created a patch for it (see attachement)

file attachments

comments

jocaba wrote Aug 24, 2010 at 6:29 AM

Applied patch in trunk

raposoc wrote Nov 23, 2010 at 4:05 PM

When using this patch, I am attempting update the version number dynamically from a build box. We are setting the enviroment variable for a value, and then runs mvn clean package command. The problem I am receiving is that after it is run, I get the previous build number, and the assembly value is updated.

Steps to reproduce:
Assembly.cs
AssemblyVersion("0.0.0.4")

POM:
<version>0.0.0</version>

CMD:
set BUILD_NUMBER=5
echo %BUILD_NUMBER%
(returns 5)
mvn clean package

Builds a dll into target directory with file version 0.0.0.4
Updates Assembly.cs so that AssemblyVersion("0.0.0.5")

CMD:
set BUILD_NUMBER=5
mvn clean package

Builds a dll into target directory with file version 0.0.0.4
Updates Assembly.cs so that AssemblyVersion("0.0.0.5")

set BUILD_NUMBER=6
echo %BUILD_NUMBER%
(returns 6)
mvn clean package

Builds a dll into target directory with file version 0.0.0.5
Updates Assembly.cs so that AssemblyVersion("0.0.0.6")

After reviewing the target directory, my team and I have found that the folder build-sources assemblyinfo.cs file is not being updated. Rather it is updating the project assembly file (referenced in Visual Studio), but compiling off of the build-sources. This does not seem to me to be correct functionality, so I am confused if this is really fixed at all.

Are there some steps I am missing?

artemfedorenko wrote Nov 23, 2010 at 4:43 PM

Hi

Try to use "clean install" instead of "clean package".

I am using this from Hudson through environment variable without any problem.

wrote Feb 14, 2013 at 2:18 AM

wrote May 16, 2013 at 7:33 AM

wrote May 16, 2013 at 7:33 AM

wrote Jun 14, 2013 at 8:48 AM