blitz_jones
blitz_jones

Reputation: 1078

File version 0.0.0.0 in Windows Explorer file properties 'Details' tab of .exe compiled with Visual Studio 2017

In Visual Studio 2010 if my AssemblyInfo.cs contained these lines (where "2010.1.2.3.4" would actually be the current year.month.day.hour.minute):

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

I could then look at the file properties in Windows Explorer of the resultant .exe and the details tab would show:

File version 2010.1.2.3
Product version 2010.1.2.3.4

However, in Visual Studio 2017 with the exact same AssemblyInfo.cs the resultant .exe file properties details tab shows:

File version 0.0.0.0
Product version 2010.1.2.3.4

There appear to be many similar postings on SO, but I can't find any exact matches that explain why this is happening or how to fix it so that "File version" displays as 2010.1.2.3 when building the .exe with VS2017 just like it did when building the .exe with VS2010.

Upvotes: 1

Views: 1747

Answers (1)

blitz_jones
blitz_jones

Reputation: 1078

As pointed out by @TnTinMn it turns out that the issue was with including 5 component numbers in AssemblyFileVersion instead of the expected/typical 4, which produced unreliable results, as documented here:

The file version is normally a string of four numbers, separated by periods, reflecting the major version number, minor version number, build number, and revision number; for example, "1.0.4309.00". If version is not in this format, a compiler warning occurs, and the results displayed in the file properties dialog are unpredictable. Wildcards are not supported.

After updating the AssemblyInfo.cs AssemblyFileVersion to only contain 4 component numbers, the problem disappeared.

Upvotes: 2

Related Questions