Bug 20057

Summary: Retrieving file version information - .Net v Mono
Product: [Mono] Compilers Reporter: Neale Ferguson <neale>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description Neale Ferguson 2014-05-27 10:10:50 UTC
When compiling an assembly, the File version info of the file is set by reading the AssemblyInfo.AssemblyFileVersion attribute. On mono it seems to be reading the AssemblyVersion attribute.

As a test, set these 2 attributes into an assembly:
[assembly: AssemblyVersion("2011.04.0.0")]
[assembly : AssemblyFileVersion("2011.02.0.0")]

Then build it and try this:
Assembly executingAssembly = Assembly.GetAssembly(typeof(Runtime));
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(executingAssembly.Location);
string version1 = fvi.FileVersion;
Console.WriteLine("version: "+version1);

In our test it was returning 2011.04.0.0 but on Windows it would return 2011.02.0.0 and right clicking on the files in Windows Explorer would show the same things. Could Linux be putting this in a different area?
Comment 1 Marek Safar 2014-05-28 05:01:08 UTC
Fixed in master