0

I've added the AssemblyInfo Task reference to my C# project file (VS2008 .NET 3.5), but when I build I get the following error

The "AssemblyInfo" task failed unexpectedly. System.ArgumentException: version Parameter name: The specified string is not a valid version number at Microsoft.Build.Extras.Version.ParseVersion(String version) at Microsoft.Build.Extras.AssemblyInfo.Execute() at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

My assemblyinfo file has these two attributes:

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Glenn Slaven
  • 33,720
  • 26
  • 113
  • 165

1 Answers1

0

Try setting AssemblyVersion to "1.0.*" and commenting the AssemblyFileVersion line.

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

If it still doesn't work, you could try using the AssemblyInfo task of MSBuild Community Task

<AssemblyInfo CodeLanguage="CS"  
              OutputFile="AssemblyInfo.cs" 
              AssemblyVersion="1.0.0.0" 
              AssemblyFileVersion="1.0.0.0" />
Julien Hoarau
  • 48,964
  • 20
  • 128
  • 117
  • I get this error(OutputFile not supported)... C:\AAROOT\csharpprojects\toolbar\project.build(17,19): error MSB4064: The "OutputFile" parameter is not supported by the "AssemblyInfo" task. – Dean Hiller Nov 15 '12 at 14:45