BoolBySigma / UpdateAssemblyInfo

SORRY THIS IS NO LONGER MAINTAINED
10 stars 9 forks source link

Version string portion was too short or too long. #7

Closed flanagak closed 7 years ago

flanagak commented 7 years ago

When attempting to update just a single AssemblyInfo file I keep getting this error. I have tried setting the "Assembly Info" field with wildcards and with complete path to the file. I was able to update the AssemblyInfo file from another project within the same solution without error.

I have tried setting my new version with both static numbers and with variables, same result. I thought it may be the "Informational Version" I am using which is $(Date:yy)$(DayOfYear).$(Rev:rr) So I removed that completely and still get the same result.

Here is the output from your extension:

2017-05-04T14:41:53.1947376Z ##[section]Starting: Update Assembly: MyTest
2017-05-04T14:41:53.2103616Z ==============================================================================
2017-05-04T14:41:53.2103616Z Task         : Update Assembly Info
2017-05-04T14:41:53.2103616Z Description  : Update assembly info of one or multiple projects
2017-05-04T14:41:53.2103616Z Version      : 2.0.22
2017-05-04T14:41:53.2103616Z Author       : Bool (by Sigma)
2017-05-04T14:41:53.2103616Z Help         : Having Problems? Please [create an issue on our Github](https://github.com/BoolBySigma/UpdateAssemblyInfo/issues) and we will try to help you.
2017-05-04T14:41:53.2103616Z ==============================================================================
2017-05-04T14:41:55.0920341Z 
2017-05-04T14:41:55.0920341Z Parameter                                                                                                         Value
2017-05-04T14:41:55.0920341Z ---------                                                                                                         -----
2017-05-04T14:41:55.0920341Z Add Missing Attriutes                                                                                              True
2017-05-04T14:41:55.1076560Z Description                                                                                                            
2017-05-04T14:41:55.1076560Z Configuration                                                                                                   release
2017-05-04T14:41:55.1076560Z Company                                                                                                                
2017-05-04T14:41:55.1076560Z Product                                                                                                                
2017-05-04T14:41:55.1076560Z Copyright                                                                                                              
2017-05-04T14:41:55.1076560Z Trademark                                                                                                              
2017-05-04T14:41:55.1076560Z Informational Version                                                                                          17124.15
2017-05-04T14:41:55.1076560Z Com Visible                                                                                                       False
2017-05-04T14:41:55.1076560Z File Version                                                                                                   3.9.2.10
2017-05-04T14:41:55.1076560Z Assembly Version                                                                                               3.9.2.10
2017-05-04T14:41:55.1076560Z 
2017-05-04T14:41:55.1076560Z 
2017-05-04T14:41:55.1389026Z Updating...
2017-05-04T14:41:55.2482642Z ##[error]Version string portion was too short or too long.
2017-05-04T14:41:55.2951337Z ##[section]Finishing: Update Assembly: MyTest

Since it only happens on some AssemblyInfo files and not others. Here is the AssemblyInfo.vb contents. This is identical to one that works other than the text for Title and Description.

Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' General Information about an assembly is controlled through the following 
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.

' Review the values of the assembly attributes

<Assembly: AssemblyTitle("MyApp")> 
<Assembly: AssemblyDescription("MyDescription")> 
<Assembly: AssemblyCompany("MyCompany")> 
<Assembly: AssemblyProduct("MyProduct")> 
<Assembly: AssemblyCopyright("Copyright © 2015 MyCompany")> 
<Assembly: AssemblyTrademark("")> 

<Assembly: ComVisible(False)>

'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("2500c6df-e052-4151-a6b4-665095acb7b8")>

' Version information for an assembly consists of the following four values:
'
'      Major Version
'      Minor Version 
'      Build Number
'      Revision
'
' You can specify all the values or you can default the Build and Revision Numbers 
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("3.9.2.10")> 

<Assembly: AssemblyVersion("3.9.2.10")>
<Assembly: AssemblyFileVersion("3.9.2.10")>
<Assembly: AssemblyInformationalVersion("1.0.0.0")>
flanagak commented 7 years ago

Ok some more info....

If I use the ... next to the Assembly Info and navigate all the way to the file I get a path that looks like this. $/xSolution Suite/Trunk-xSolution/Releases/_Call-Handling/C3.9.2.10/xT911/Source/Controls/My Project/AssemblyInfo.vb With this configuration the file is updated.

Obviously I want to update all the AssemblyInfo files in my solution so I start replacing folders with wildcards. Changing the above path to the following causes a file not found `$/xSolution Suite/Trunk-xSolution/Releases/_Call-Handling/C3.9.2.10/xT911/Source/Controls/*/AssemblyInfo.

[error]Cannot find path 'C:\agent_work\3\s\$\xSolution Suite\Trunk-xSolution\Releases_Call-Handling\C3.9.2.10\xT911\Source\Controls' because it does not exist.`

Removing the $ from the path so it is: /xSolution Suite/Trunk-xSolution/Releases/_Call-Handling/C3.9.2.10/xT911/Source/Controls/**/AssemblyInfo.* No longer gives the "cannot find path" error but I now get the "Version String too short or long"

I have also tried use the generic **/AssemblyInfo.* so it would update all files in all folders and I still get the "Version String too short or long" error.

Any help would be appreciated.

flanagak commented 7 years ago

Figured it out..... was our current checked-in AssemblyInfo files causing the issue. They have a version stamp of 3.9.2.10.17132.1.

Would be great if the extension recognized that you are replacing that value and did not fail because the current value is invalid.

ghost commented 7 years ago

Glad it you solved your problem.

I will consider your suggestion for a possible future enhancement.