Changing the behavior of the AssemblyInformationalVersion attribute: intentional or error?

In a C # project built with VS2013, I can put it in the AssemblyInfo.cs file:

[assembly: AssemblyInformationalVersion("7.1.0.0 Private (Debug build)")]

When I used the FileVersionInfo.GetVersionInfo.NET API for an executable from another project, I found these values:

  • Product Version: 7.1.0.0 Private (debug build)
  • ProductMajorPart: 7
  • ProductMinorPart: 1

When I use the same attribute and string value in a C # project built with VS2015, the ProductMajorPart and ProductMinorPart properties are reported as zero!

Does anyone know if behavior change is intended?

I examined the binary version information found in the executables, and although the string values ​​in the version information were expected in both files, the VS2015 executable has zero values ​​in the VS_FIXEDFILEINFO.dwProductVersionMS and VS_FIXEDFILEINFO.dwProductVersionLS fields.

+4
source share
1 answer

I can confirm the change in behavior for this case, noting that if it AssemblyInformationalVersionis in the canonical format, for example "7.1.0.0", then it works as expected in all versions, that is, in the product version major / minor / build / the edit fields are filled.

For the background, the docs for AssemblyInformationalVersion do indicate that:

, , . , Application.ProductVersion.

[...] , , , [...]

:

  • , , ;

  • .

VS connect, , MS AssemblyInformationalVersion "" , , , "" .

, VS 2010 AssemblyInformationalVersion ALINK AL1053 MS won't fix.

CS1607 ", " ", " major.minor.build.revision" ? , major.minor.build.revision, .

+1

Source: https://habr.com/ru/post/1620806/


All Articles