Bug 20057 - Retrieving file version information - .Net v Mono
Summary: Retrieving file version information - .Net v Mono
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-05-27 10:10 UTC by Neale Ferguson
Modified: 2014-05-28 05:01 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

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