1

I am using the 64 bit msbuild extensions and I have this in my build file

<AssemblyInfo AssemblyInfoFiles="$(MSBuildProjectDirectory)\DesktopAgent\properties\AssemblyInfo.cs" 
              AssemblyCopyright="Copyright 2012 Alpine Access" 
              AssemblyVersion="1.0.0.0"
              AssemblyFileVersion="1.0.0.0"
              >
</AssemblyInfo>

I have this in my assemblyInfo.cs if it matters

[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyFileVersion("2.1.0.0")]

second line is commented out as I read that in another post but it didn't help.

I get the following error

C:\AAROOT\csharpprojects\toolbar\project.build(17,5): error MSB4018: System.Arg
umentException: The specified string is not a valid version number\r

2 questions

  1. why do I get this error
  2. Will this task overwrite/modify my previous AssemblyInfo.cs file? (I don't know whether AssemblyInfoFiles is the input/output or both)

On a side note, the property $(MSBuildExtensionsPath) gets set to the 32 bit path for some odd reason(I only installed the 64 bit tools so that path doesn't work and I have to set the property manually....is this some kind of bug in their installer that they didn't set that property correctly?

thanks, Dean

Dean Hiller
  • 19,235
  • 25
  • 129
  • 212

1 Answers1

2

Got the same result here, when i tried what you have. Looks like a genuine bug, if your existing assemblyinfo file has 1.0.* in it. Strange, anything that is not a valid version number causes the same problem. Works a treat if you remove the 1.0.* though. Id just make it 1.0.0.0 and replace via the task.

James Woolfenden
  • 6,498
  • 33
  • 53
  • 1
    so, if I change 1.0.* to 1.0.0.0, the task will correctly modify it to 1.2.3.56? (I am not on-site with that client right now but will have to try that). I assume I still keep the file version commented out, right? – Dean Hiller Nov 16 '12 at 14:18
  • yes, I plan on using it. We read it and display it in the gui and out autobuild increments the number every time we checkin. We use 1.2.3.56, 1.2.3.89, etc. etc or whatever passes QA and all the in between numbers like 1.2.3.57 are thrown away(ie. never used). – Dean Hiller Nov 16 '12 at 18:42
  • hmmm, this did not work, I got the error C:\AAROOT\csharpprojects\toolbar\project.build(17,5): error MSB4018: System.Arg umentNullException: Value cannot be null.\r C:\AAROOT\csharpprojects\toolbar\project.build(17,5): error MSB4018: Parameter name: input\r – Dean Hiller Nov 17 '12 at 14:46
  • okay, so turns out I need both AssemblyVersion and AssemblyFileVersion...thanks! – Dean Hiller Nov 17 '12 at 14:49