Error when using the AssemblyInfo task

Jan 19, 2012 at 2:12 PM

Hi,

I am trying to use the AssemblyInfo task. I am currently using V3.5.9.0 of the Extension pack

I have the following entry in my msbuild project file.

 <MSBuild.ExtensionPack.Framework.AssemblyInfo AssemblyInfoFiles="$(AssemblyInfoFiles)" AssemblyVersion="1.2.3.4" SkipVersioning="false"/>

But when trying to run this task, I get the error listed below. I am new to MSBUILD so would appreciate any help on how to debug what this error means.

Any ideas as to what i might be missing here?


Build FAILED.

"C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj" (default target)
 (1) ->
(UpdateAssemblyVersion target) ->
  C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB
4018: The "MSBuild.ExtensionPack.Framework.AssemblyInfo" task failed unexpected
ly.\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18: System.ArgumentNullException: Value cannot be null.\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18: Parameter name: input\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18:    at System.Text.RegularExpressions.Regex.Matches(String input)\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18:    at MSBuild.ExtensionPack.Framework.Version.ParseVersion(String version)
in D:\Projects\MSBuildExtensionPack\Releases\3.5.9.0\Main3.5\Framework\Framewor
k\AssemblyInfo\Version.cs:line 51\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18:    at MSBuild.ExtensionPack.Framework.AssemblyInfo.Execute() in D:\Projects
\MSBuildExtensionPack\Releases\3.5.9.0\Main3.5\Framework\Framework\AssemblyInfo
\AssemblyInfo.cs:line 1023\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITa
skExecutionHost.Execute()\r
C:\Program Files\MSBuild\ExtensionPack\Practice\BuildMe.proj(49,4): error MSB40
18:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExec
utionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost ta
skHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskRes
ult)

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.20

Coordinator
Jan 31, 2012 at 4:28 PM

Hi

Have you seen the help here for using the task? http://www.msbuildextensionpack.com/help/4.0.4.0/html/d6c3b5e8-00d4-c826-1a73-3cfe637f3827.htm

Mike

Jun 6, 2012 at 12:58 PM

I was getting the exact same error (with 4.0.5.0) and it was a complete mystery as I thought I had followed the help, after a quick dive into the source code I spotted that it was using RegEx to parse the version number and although it looked fine it reminded me that I had included a comment in my assembly info file on the same line as the version, after removing my comment I was able to set the version without issue. Who needs comments anyway ;), hope this helps someone.

Nyami