Search Wiki:
This updated version includes fully-signed binaries, an updated installer to support non-admin installs, and support for Visual J# projects.
Last edited Jun 20 2007 at 5:52 PM  by neile, version 1
learnerplates wrote  Apr 16 2008 at 1:25 PM  
Hi, This tool looks good but I've just tried it and gotten a compiler error
Error 2 Error emitting 'System.Reflection.AssemblyVersionAttribute' attribute -- 'The version specified '1.0.080416.01' is invalid' C:\Documents and Settings\nfallon\My Documents\Visual Studio 2005\Projects\VersionUpdateTest\VersionUpdateTest\Properties\AssemblyInfo.cs 34 12 VersionUpdateTest

The AssemblyInfo.cs has
[assembly: AssemblyVersion("1.0.080416.02")]
[assembly: AssemblyFileVersion("1.0.080416.02")]

Your task assembly is in the GAC.

AlSki wrote  Apr 22 2008 at 9:19 AM  
Hmmm. I don't think that the 3 part of the version string is capable of holding such a large number. I've never seen more than 5 digits in there before, I also belive it is a number not a string so the leading zero is likely to be strippped.
Instead of using a date I would suggest you use the more common number of days since...

Assaf wrote  Jul 10 2008 at 6:42 PM  
Can You have the version in a link assembly file (with a different name)?

overslacked wrote  Nov 18 2008 at 9:58 PM  
Any chance you'll change the licensing? I'm looking for tools to automate my build process and something like this sounds very useful, but it's a commercial project.

MartinHyldahl wrote  Nov 20 2008 at 1:55 PM  
Learnerplates, you are experiencing the y2k7 problem with version numbers. Version number parts is limited to 65535, so the AssemblyInfo task default for build number part (yyMMdd) will not work.

CommonGenius wrote  Nov 28 2008 at 7:15 PM  
I too would like to use this task in a commercial project. What is the point of releasing this under a non-commercial license? Is there any chance the license can be changed?

danmose wrote  Dec 9 2008 at 11:01 PM  
I don't know why the license got changed to non-commercial. I am trying to find out if I can change it back.
Dan [MSFT]

danmose wrote  Dec 11 2008 at 12:47 AM  
The license has now been changed back.

By the way, there is currently nobody contributing to this project. If anyone would like rights to improve the source code, please let me know.

jasper22 wrote  Feb 26 2009 at 1:34 PM  
Why 'Subversion fix' doesn't come in standard package ???
Here is the fix: (this is not my blog)

learnerplates wrote  Mar 9 2009 at 12:34 PM  
nearly 1 year later I back to this task and it still doesn't work.

I'm trying to follow the instructions on msdn ,
There's an msbuild code snippet in there which says that there is a task included in the AssemblyInfo task named "ConvertTFSBuildNumberToSolutionBuildNumber" which is supposed to fix the asebmyl numer issue, it doesn't exists.
It also mentions a task "RewriteFileVersions", this doesn't exist either, anyone??????

<Target Name="BuildNumberOverrideTarget">
<Message Importance="High" Text="$(BuildNumber)" />

<Output TaskParameter="SolutionBuildNumber" PropertyName="SolutionBuildNumber" />
<Output TaskParameter="TFSBuildNumber" PropertyName="BuildNumber" />
<Message Importance="High" Text="$(SolutionBuildNumber)" />
<Message Importance="High" Text="$(BuildNumber)" />

<Target Name="BeforeCompile">
<Message Importance="High" Text="$(SolutionBuildNumber)" />
<CreateItem Include="$(SolutionRoot)\**\AssemblyInfo.cs">
<Output TaskParameter="Include" ItemName="AssemblyInfoFiles"/>
<CreateItem Include="$(SolutionRoot)\**\AssemblyInfo.vb">
<Output TaskParameter="Include" ItemName="AssemblyInfoFiles"/>
AssemblyInformationalVersionNumber="$(SolutionBuildNumber)" />

cosmos wrote  Aug 24 2009 at 2:07 PM  

I have used this used this tool but one problem remaining.
My assembly version is updated on TFS after the build so I have always the previous version of the build number.
Could you help me ?

This is my TFSBuild.proj

<!-- Assembly version properties. Add others here -->

<!-- TF.exe -->

<!-- AssemblyInfo file spec -->

<!-- Set this to non-existent file to force rebuild. -->
<IntermediateAssembly Include="$(SolutionRoot)\foobar.dll"/>

<Target Name="AfterGet" Condition="'$(IsDesktopBuild)'!='true'">
<!-- Set the AssemblyInfoFiles items dynamically -->
<CreateItem Include="$(SolutionRoot)\**\$(AssemblyInfoSpec)">
<Output ItemName="AssemblyInfoFiles" TaskParameter="Include" />

<Exec WorkingDirectory="$(SolutionRoot)"
Command="$(TF) checkout /recursive $(AssemblyInfoSpec)"/>

<Target Name="AfterCompile" Condition="'$(IsDesktopBuild)'!='true'">
<Exec WorkingDirectory="$(SolutionRoot)"
Command="$(TF) checkin /comment:&quot;Auto-Build: Version Update&quot; /noprompt /override:&quot;Auto-Build: Version Update&quot; /recursive $(AssemblyInfoSpec)"/>
<!-- In case of Build failure, the AfterCompile target is not executed. Undo the changes -->
<Target Name="BeforeOnBuildBreak" Condition="'$(IsDesktopBuild)'!='true'">
<Exec WorkingDirectory="$(SolutionRoot)"
Command="$(TF) undo /noprompt /recursive $(AssemblyInfoSpec)"/>

Thank you

mikefourie wrote  Nov 7 2009 at 12:31 PM  

This task is now maintained in the MSBuild Extension Pack. Please log an issue there if you are still having a problem.



youngd24 wrote  Oct 1 2010 at 5:51 PM  
Question. I want to have the major version set to 2 for one particular project, not system wide for the dll I installed into the GAC. CHM has this example:


Can I set this somewhere in my project or AssemblyInfo file just for that project?

Page view tracker