Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Version.txt should use file version from assembly custom attributes not FileVersionInfo #4505
The changes made in issue #3132 have introduced a bug due to relying on a physical location for the assembly. If the Microsoft.ML.Core assembly is loaded from memory the assembly.location will be empty. Using FileVersionInfo.GetVersionInfo relies on a physical path - so an argument exception is thrown inside System.IO.Path since the supplied path is empty.
Instead of using FileVersionInfo.GetVersionInfo the assembly custom attributes should be used, for example:
This will return the same product string version as the FileVersionInfo.GetVersionInfo does.
Happy to contribute. In my scenario I am working with a system where assemblies can be loaded from disk or stored in a database. Though in this case they are loaded from disk the assembly is read as bytes then loaded - hence location is blank.