msbuild Assembly number - Get wrong number

136 views Asked by At

I have the following code in my CommonAssemblyInfo.cs

using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;

[assembly: AssemblyCompany("XXXX")]
[assembly: AssemblyProduct("BuildVersionTest")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright 2012")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyVersion("4.0.*")]
[assembly: AssemblyFileVersion("4.0.6.121017")]
[assembly: AssemblyInformationalVersion("4.0.0.0")]

In my project I have this file linked and I also have the assemblyinfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("BuildToolUtility")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("cfgfsfdrf68e-5af7-44f0-b310-f8a8191465fd")]

when I the build my dll file Version has

4.0.6.55481

Why? shouldnt it have what is in my CommonAssemblyInfo.cs?

Check this picture: http://postimage.org/image/nrtab3hk1/

and then in the output window it shows another verison???? I can get this.

10:11:52 AssemblyVersion:
10:11:52   ***** Start getting assemblyVersion *****
10:11:52   4.0.4673.16477
10:11:52   ***** Done getting assemblyVersion *****
10:11:52 BuildRepositoryZip:
10:11:52   ***** Start zipping deploy folder. Making package *****
10:11:52   4.0.4673.16477
10:11:52   Creating ZipFile: ..\..\4.0.4673.16477.zip
10:12:11   ***** Done zipping deploy folder. Making package *****
1

There are 1 answers

0
James Woolfenden On

The number used by your version file attribute is too high, so its overflowing as its a Uint16. You should see something like warning CS1607: Assembly generation -- The version '4.0.6.160017' specified for the 'file version' is not in the normal 'major.minor.build.revision' format. So you cant use your raw svn revision number once your svn repo get old enough...